Return index number using map array function | Community
Skip to main content
Level 3
July 28, 2023
Question

Return index number using map array function

  • July 28, 2023
  • 1 reply
  • 922 views

Hi All

Quick question

Often i have a need where i would like to use the Map function to identify certain objects meeting the filter criteria i set.

 

For instance: map([TASKS ARRAY];ID;categoryID;<CATID TO SEARCH>)

 

This works fine to retrieve that task ID, but most of the time i would like to pick a few more fields for onward processing. Ideally i would use the get function but in order to do this I would need to know the index number of those returned items within the array.

 

Is there a way to use the map function to retrieve the index number? I'm sure we used to be able to to do this in the previous version of fusion....

 

Thanks

 

 

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

1 reply

Level 5
July 28, 2023

I've done something similar to this using the following type of technique:

 

I've attached a blueprint that should show you how to do it.  But in short:

  1. Init your array using something like add(emptyarray; a; b; c)
  2. Create your indices using a Repeater from 0 to length(array)
  3. Grab the element at index i using get(arrayi).