Overview
Sometimes you may want a choice slot to have its results filtered, to show a subset of the total choices available based on some criteria. These choice filters can be configured in the "Attributes" section of a choice slot record.
Format
Choice filters follow the standard "query" format found throughout the platform. Examples seen below:
- [[["last_name","eq","bennett"]]] - the last name equals "bennett"
- [[["gender","ne","male"]]] - the gender does not equal "Male"
- [[["first_name","contains","jer"]]] - the first name contains the string "jer"
- [[["user_id","notcontains","bow"]]] - the user id does not contain the string "bow"
- [[["user_id","begins","jess"]]] - the user id starts with the string "jess"
- [[["last_name","ends","tt"]]] - the last name ends with the string "tt"
Multiple queries can be strung together using the following and/or (pipe or semicolon, respectively) syntax:
- [[["first_name","eq","aaron"],["gender","eq","male","Male"]]] - First name is Aaron AND gender is Male
- [[["first_name","eq","aaron"]],"OR",[["gender","eq","male","Male"]]] - First name is Aaron OR gender is Male
Dynamic Queries
Sometimes you'll want to use data entered elsewhere in the record to filter choices. A common example of this is filtering the "subcategories" to only those associated with the currently selected "category". In order to accomplish this, you'll want to use the $record syntax to point to the value on the current record. For example, the above mentioned example would be accomplished using the following:
- [[["parent","eq","$record.category"]]] - show me only the subcategories, who have a "parent" of the currently selected category
Examples
- [[["type","eq","extender"]]] - (used in the "Data Service" slot on the "Bucket" bucket) Show all data service records whos type is "extender"
- [[["parent","eq","$record.navigator"]]] - (used on the "Navigator item" slot on the "Security navigator" bucket) Show all navigator item records, whos "parent" is the same as the current record's "navigator"
- [[["location","eq","$record.location"]]] - Show all user records who's "location" is the same as the current record's "location"