Expand my Community achievements bar.

Do you have questions about the migration to Adobe Business Platform? Come join our upcoming coffee break and ask away!
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 @EstheVThorsenngc1569 - 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 @EstheVThorsenngc1569 - 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 5

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.

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