Expand my Community achievements bar.

Join us LIVE in San Francisco on November 14th for Experience Makers The Skill Exchange. Don't miss out on this free learning event!
SOLVED

Struggling with filtering an array item in Fusion

Avatar

Level 3

Hello

 

My struggle is that I have an array from querying Workfront's "Read a Record" module. 

As shown in the screenshot, the output contains a tasks array (1-9):

Capture.PNG

 

What I wanted to do is:

 

If the task name of an item (in the array) equals "ABC", do this;

Otherwise, do that

 

How best to do this kind of filtering condition to an array in Fusion? 

Please could someone shed some lights on this?

 

Thanks!

1 Accepted Solution

Avatar

Correct answer by
Level 7

Hi @ibmfur - Add the "Iterator" module next to it, and map "tasks" array to get the tasks as bundles that you can filter.

_Manish_Singh_0-1711468802835.png

View solution in original post

3 Replies

Avatar

Correct answer by
Level 7

Hi @ibmfur - Add the "Iterator" module next to it, and map "tasks" array to get the tasks as bundles that you can filter.

_Manish_Singh_0-1711468802835.png

Avatar

Level 6

You can also use the map() function to do some filtering.  Check out the "array" functions.  (https://experienceleague.adobe.com/en/docs/workfront/using/adobe-workfront-fusion/functions-in-fusio...)

But yes, the iterator approach from Manish is the most common way to think about this problem.

Avatar

Level 3

Great stuff. Havent used the map() function before but thanks for sharing this.