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
It worked for my scenario, thank you! I was able to get and Index according to each item index in excel table! and update my sharepoint list automatically!
User | Count |
---|---|
93 | |
45 | |
19 | |
19 | |
15 |
User | Count |
---|---|
137 | |
54 | |
42 | |
42 | |
30 |