load( /*ri!exchanges = values that would come from your checkboxField*/ /*If you stored your exchanges in a constant*/ local!exchangeConstant:{"CMEEL", "CMECE", "CBOT", "OTHER"}, /*Pull the index position of your exchange choices*/ local!exchangeIndexes:wherecontains(ri!exchanges, local!exchangeConstant), /*What classes each exchange currently have*/ local!classes: { "Agricultural, Energy, Foreign Exchange", /* CMEEL */ "Agricultural, Energy, Foreign Exchange", /* CMECE */ "Agricultural, Energy, Foreign Exchange", /* CBOT */ "Agricultural, Equity, Interest Rates" /* OTHER */ }, /*Pulls which rows of classes to retrieve based on Exchange Indexes*/ local!classIndexes:apply( index(local!classes, _, {}), {local!exchangeIndexes} ), /*Splits result from local!classIndexes into multiple text values (for checkbox purposes) */ local!splitIndexes:split(local!classIndexes, ","), /*Removes duplicates*/ local!removedDuplicates:union(local!splitIndexes, local!splitIndexes), local!removedDuplicates )