Struggling with filtering an array item in Fusion | Community
Skip to main content
Level 3
March 26, 2024
Solved

Struggling with filtering an array item in Fusion

  • March 26, 2024
  • 1 reply
  • 1218 views

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):

 

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!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by _Manish_Singh

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

1 reply

_Manish_Singh
_Manish_SinghAccepted solution
Level 9
March 26, 2024

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

Level 5
March 26, 2024

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-fusion/array-functions)

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

ibmfurAuthor
Level 3
March 27, 2024

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