Records filtered by Dynamic Multiple Choice
So, I have many fields that are dynamic "single" choice. My goal is to filter data using a multiple choice dynamic field but am having issues with scripting it correctly.
For instance, I want to filter data based on Lead Source and Lead Student Type. In my these fields are dynamic choice. Now on a separate table, I want to be able to filter that data using a dynamic multiple choice using the same table reference as my dynamic choice. I can filter by only selecting one from each, but I can't filter by selecting multiple values. Any help is greatly appreciated. A sample code of what I am currently using is below:
let curRec := this;
let xStart := 'Start Date';
let xEnd := 'End Date';
let xSource := 'Lead Source';
let xType := 'Lead Student Type';
count(select Leads
where Status = 26 and 'Lead Entered Date' >= xStart and 'Lead Entered Date' <= xEnd and
'Lead Source' = xSource and
'Lead Student Type' = xType)
4 replies
-
Once you start working with multiple choice fields (regular or dynamic) then you can't use the equal sign so easily.
Luckily now you can use the contains() function to filter on arrays, so maybe try:
let curRec := this; let xStart := 'Start Date'; let xEnd := 'End Date'; let xSource := 'Lead Source'; let xType := 'Lead Student Type'; count(select Leads where Status = 26 and 'Lead Entered Date' >= xStart and 'Lead Entered Date' <= xEnd and contains(xSource, 'Lead Source') and contains(xType,'Lead Student Type')
You might need to wrap all the fields in numbers(), for multi choice fields, or number(), for single choice fields.
-
Oh my, I feel like an idiot. I didn't think the order of arrangement mattered, but it does. I had my reference field first instead of my filtered field. Wow, such a simple solution.
Content aside
- Status Answered
- 9 mths agoLast active
- 4Replies
- 86Views
-
2
Following