Say you have collectionA which holds your courses data. It has a reference field called SessionCode that references another collection - collectionB.
On your lightbox, add a dataset and connect it to collectionB. When you get the data in the lightbox using getContext, create a filter on this dataset to get all the items that have the SessionCode you received.