cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Assign Array Elements

Hello,

 

I am trying to access the individual elements of an array and assign them to a new value. This is extremely simple in actual code, but I am not sure how to go about doing this in Microsoft Flow. Any help is greatly appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Dual Super User II
Dual Super User II

Re: Assign Array Elements

Sorry, here was the link I forgot to include.

https://powerusers.microsoft.com/t5/Building-Flows/Accessing-Array-elements/td-p/62134



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

4 REPLIES 4
Highlighted
Dual Super User II
Dual Super User II

Re: Assign Array Elements

Take a look at the solution in this thread.  It shows how to access individual array elements.  I've also done it with a Do until loop which has a current iteration value that increments during each loop.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Highlighted
Anonymous
Not applicable

Re: Assign Array Elements

I think I can access the array elements just fine. This involves using the square brackets as an operator to index into the array, so it would look something like variables('array_name')[index]. I am also not able to see what thread you are referring to or the link if you provided it, unfortunately.

The problem is, I need to be able to assign a value in the array to be a desired value, then later in the Flow access that value from the array. I suppose the problem here is that I do not know how to overwrite and store a value into an array at a specified index without appending it to the end. For assignment, I need to get the current array value, overwrite it to be the desired value, then store it back into the array. The first step I can do, but the other two are beyond me.

Highlighted
Dual Super User II
Dual Super User II

Re: Assign Array Elements

Sorry, here was the link I forgot to include.

https://powerusers.microsoft.com/t5/Building-Flows/Accessing-Array-elements/td-p/62134



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

Highlighted
Anonymous
Not applicable

Re: Assign Array Elements

Thanks for providing that, it looks like it confirms my previous understanding of how to access an array element at a given index. Now I just need to figure out how to store a new value at that index for later usage.

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (7,958)