Hi all,
I created a select action in *From in put array of object names Value and in *Map I put this expression
json(replace(string(outputs('Compose_9')),concat('[',outputs('Compose_6'), ']'),string(item()?[outputs('Compose_6')])))
So I know that item() is returns the item that is in the array names Value but I want to get an index of each value in the array.
Is it possible to get index of each value in the array in the select action.
Thank you for the advice
Solved! Go to Solution.
Hi @pawelzebrowski ,
My idea is to add an index property into Array, which is a number that is incremented from 0. The following steps are for your reference.
1. initialize an integer variable to 0
2. create an Apply to each step to loop through each record within Array
3. add a compose step within apply to each, and put the following expression into Inputs field.
addProperty(item(),'index',variables('varNum'))
4. add a Set variable steps to make variable increment by 1
add(outputs('Compose_3')?['index'],1)
5. create a Select steps out of Apply to each loop, reference the output of compose step mentioned in step 3 in From field, then use item()?['index'] to get index of array.
Hope this helps.
Sik
Hi @pawelzebrowski ,
My idea is to add an index property into Array, which is a number that is incremented from 0. The following steps are for your reference.
1. initialize an integer variable to 0
2. create an Apply to each step to loop through each record within Array
3. add a compose step within apply to each, and put the following expression into Inputs field.
addProperty(item(),'index',variables('varNum'))
4. add a Set variable steps to make variable increment by 1
add(outputs('Compose_3')?['index'],1)
5. create a Select steps out of Apply to each loop, reference the output of compose step mentioned in step 3 in From field, then use item()?['index'] to get index of array.
Hope this helps.
Sik
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
31 | |
27 | |
27 | |
21 | |
10 |