Limit options when searching a list that is a subset of a data object

I have a List widget that contains a subset of the records in a data object. One of the fields (Field A) in the data object is a Choice field with 5 possible values. As a result of the subset, the List widget will only ever include records with 3 of the 5 choices for Field A.

I want to apply a Search to the list, and one of the fields in the search is Field A. In the drop-down for Field A it displays all 5 choices. I would like to make it display only those 3 choices that are included in records in the List. However, I cannot see any way of doing this.

Any ideas?

Hi Angela,

This cannot be done in Build Studio yet.

But you can use a Code Studio Callback (set on the search fragment) to filter out the choices you don’t want:

var choices = fragment_presenter.get_template_data(‘choices’);
// change choices here
fragment_presenter.set_template_data(‘choices’, choices);

The choices array is numerically keyed. You could depend on the order but I’d recommend looping over them and checking each id against a set of choice References.

Paul