web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Get a variable from fi...
Power Automate
Answered

Get a variable from filtered array

(0) ShareShare
ReportReport
Posted on by

I am trying to add version numbers into an SP list, but I can't figure out how to pull a variable from a filtered array.

  • I have an array that contains two items: Name and Version.
  • The number of items in the array is variable.
  • I use Filter Array in an Apply to Each to loop through a SharePoint list. For each item in the SharePoint list, my array is filtered down to a single item by comparing the item in the SP list to the items in my array.

Now this next part I am having trouble with. I need to get the "Version" out of that single item array. I am using compose (visible below) with variables('currentVersion')?[0]?['Version']. This works to get the item at index 0 of the unfiltered array, but I cannot figure out how to modify the expression to work on the Filter Array's Output. Changing 'currentVersion' to anything else gives me an error. I am sure I am missing something simple, but I am not sure what that is off-hand.

 

ABureaux_0-1636416575959.png

 

Categories:
I have the same question (0)
  • Verified answer
    Gopala_Krishna Profile Picture
    1,495 on at

    @ABureaux 

    to retrieve the action outputs of the "Filter Array" action you can use the expression body('Action Name'). Your Filter array action name is - "Filter array - Find the current version of survey" to complete the expression it would be

     

    body('Filter_array_-_Find_the_current_version_of_survey')

     

    To get select outputs you can add more elements to the formula such as body('Filter_array_-_Find_the_current_version_of_survey')[0]['Value'] to select the value property from the 1st element of array.

     

     

    If the information shared helps you please consider giving a thumbs up 👍 and mark solution as resolved ✔️

    Please follow my website PowerCards for more information related to Power Platform
  • ABureaux Profile Picture
    on at

    Derp. Silly me. I did previously try the expression you posted, but tried to nest it in the "Variable" expression (which obviously gave me an error).

     

    Everything is working beautifully now. Thank you!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 237 Super User 2026 Season 1

#2
David_MA Profile Picture

David_MA 173 Super User 2026 Season 1

#3
Kalathiya Profile Picture

Kalathiya 95 Super User 2026 Season 1

Last 30 days Overall leaderboard