Expand my Community achievements bar.

Interested in getting an Adobe Workfront certification? Don't miss our AMA on June 10th, where our experts will be available to answer any questions you may have about getting certified!
SOLVED

Filter Function For Checkbox Field

Avatar

Level 3

Currently trying to setup a filter in one of my scenarios. I've created a checkbox field that has several different values that users can select upon request time. If there is only one value selected then I would like Fusion to route it to another setup of modules. If there is multiple values selected then it would go a different route. 

 

What is an easy way to set this up and make sure that it reads the values?  

I know there is functions but I've not successfully setup one. 

 

Any help from the community would be greatly appreciated! 

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Level 6

Also here is another approach that tells you how many items are in the array. This approach would survive the depreciation I mentioned earlier

Add value(s) to empty array,

Flatten array of arrays if more than 1 value,

Get length of array

 

Lawson02_0-1746659320041.png

 

View solution in original post

5 Replies

Avatar

Level 6

Currently as it is checkbox like fields read one value as a string and multiple as an array. They might be changing this soon and making it always read as an array but I don't remember exactly as I read the patch notes a while ago. 

 

When dealing with these fields I will just use the toString() function and use indexOf() to check for index of commas as those are what indicate array values. If its not equal to -1 then there are more than 1.

 

Assuming you have no commas in these fields this would work. If you do have commas, then search for either [ or ]. If they implement the change I mentioned earlier this would not work.

 

Lawson02_4-1746658875069.png

 

Lawson02_2-1746658844530.png

 

Lawson02_1-1746658832712.png

 

 

Avatar

Correct answer by
Level 6

Also here is another approach that tells you how many items are in the array. This approach would survive the depreciation I mentioned earlier

Add value(s) to empty array,

Flatten array of arrays if more than 1 value,

Get length of array

 

Lawson02_0-1746659320041.png

 

Avatar

Level 3

@Lawson02 What would the filter look like after setting up this variable? 

 

I got the other method setup below and working but if they are going to change this I would rather set it up like this. 

Avatar

Level 6

Replace 

Lawson02_0-1746719360589.png

 

with 

Lawson02_1-1746719379491.png

 

change filter to "Numeric Operators: Not Equal to 1". This will be your route with more than 1 checkbox field. Set a fallback, this will be your route with only 1 checkbox field.

Avatar

Level 3

Thank you, always super helpful!