cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SBT2
New Member

Power Automate getting value from an array

Here is my Power Automate flow –

SBT2_0-1659131924418.jpeg

 

SBT2_1-1659131924423.jpeg

 

TheIndex is initialized to 0 and Alpha to 1 and each is then incremented in Apply to Each step below.

SBT2_2-1659131924430.jpeg

 

FilterArray looks as expected.

SBT2_3-1659131924438.jpeg

 

 

Get-Name works as expected and return True for the array element body('FilterArray')[variables('TheIndex')]

 

Set Name does not work. Name is set to body('FilterArray')[variables('Alpha')] rather than the value of body('FilterArray')[variables('Alpha')]

 

SBT2_4-1659131924443.jpeg

 

The results are:

 

SBT2_5-1659131924445.jpeg

 

SBT2_6-1659131924452.jpeg

 

Excel results: These are the various iterations I tried. The correct result should be Stuart which is FilterArray[3].

SBT2_7-1659131924455.jpeg

 

4 REPLIES 4
vivekpande18
Super User
Super User

Hi @SBT2 , 

You are putting the expression directly into the variable Value field, this will not work. 

 

You need to put the below expression from the expression tab into the variable, then only it will work. 

 

vivekpande18_0-1659148447749.png

 

vivekpande18_1-1659148632806.png

 

 

Thanks

Vivek Pande

 

SBT1
Frequent Visitor

Thanks for the reply. That is how I entered the expression. Is this what you meant?

SBT1_0-1659219389501.png

 

I was wrong, I had just pasted the expression into the field. When I entered in the expression dialog it worked. Thanks.

vivekpande18
Super User
Super User

You can mark this thread as Accept as solution and close it

 

Thanks

Vivek Pande

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (6,048)