nathan guzman
nathan guzman

Reputation: 1

PowerAutomate Flow Help - Update a list from two different Arrays

Would anyone be able to assist me in figuring out the logic for this flow in power automate?

I am trying to parse emails and I got to the point of pulling the data I want out and holding it in 2 arrays.

I have 2 array variables and I am trying to update a sharepoint list using both arrays.

Array 1 lets call Name Array 2 lets call ID

The sharepoint list columns would be Date / Name / ID - So when updating this list I need the Name and ID to be on the same row.

I know how to update the list by using the create new item action using 1 array but it uses the currentitem() function not sure how to iterate through both arrays while still updating the same row in sharepoint.

Here's a pic of the flow but ofc the logic not what I want. I would like to update the sharepoint in 1 loop so data is created on the same rows and kept together from the 2 arrays.

enter image description here

See image for current method I have tried.

enter image description here

I have 2 compose object lists like so:

enter image description here

I need to link the location with the token. so combining the 2 arrays if possible into a json. { Location Name: XXXXX Token: XXXX }

{Location Name: XXXX Token: XXXX } and so forth... doing this in power automate seems really hard as they seem to not allow you to do this easily.

I feel like I am close however I created a apply to each loop and for the input put the location names. Then I have to somehow call index 0 of the token array or... combine the 2 into a json object and call them both so they can be added to an excel table..

If you need more info let me know.. I just have tried a bunch of approach's and keep coming up short.

Upvotes: 0

Views: 310

Answers (1)

mmikesy90
mmikesy90

Reputation: 981

Assuming that both arrays have the same amount of items, you could iterate on one of the arrays and use a formula like this to get the values from the other array: variables('arrNames')[varriables('intIteration')] (init intIteration with 0 and increment it every time)

Upvotes: 0

Related Questions