When string-based attributes (String, List, Set) are shown as Displayed Attributes, once discrete values are added to the attribute these are all shown via a pop-up list via the triangular icon at the right end of the attribute value edit box. For fast entry, autocompletion using matched list items is also possible. However, do bear in mind limitations on the length of and number of entries in these lists.
It is possible to set suggested value lists. These can be set manually via the Inspector for user attributes (and some system attributes) or by using action code. Consider an attribute $MyStatus that will hold the status of bids. To pre-set 3 suggested values 'won', 'pending' and 'lost':
attribute("MyStatus")[suggested]=[won;pending;lost];
But, what if that list needed to change, e.g. if a new status 'cancelled' was added,? The above list could be stored in a list attribute that could be edited as a Displayed Attributes avoiding having to set the value in code. Thus a note, in this example called "TbxConfig", could store the suggested values in a List or Set (the latter so as to avoid accidental duplicates). So, its $MyList could be [won;pending;lost;cancelled]
.
Now, a stamp 'Set Suggested Status" could have this code:
attribute("MyStatus")[suggested]=$MyList("TbxConfig");
If the list needs to be altered, simply run the stamp after doing the edit.
Legacy method
The following is deprecated for the above method of using suggested values. Another way can be used is there is a note for each potential value. Thus a container 'Bid States' might hold child notes 'won', 'pending', 'lost'. This code can be used to set the $MyStatus suggested values from the children of the 'Bid States' container:
attribute("Bid States")[suggested]=collect(children(/Status),$Name);
If that code is run as a rule or edict, whenever a new note is added to, deleted from or renamed in that container, the suggested values will get updated.
See also—notes linking to here: