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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Retrieve Array value b...
Power Automate
Unanswered

Retrieve Array value by Key

(0) ShareShare
ReportReport
Posted on by 21

arrGods

{

"Love" : "Eros"

"Sea" : "Neptune"

"Slingblade" : "Billy Bob Thorton"

}

 

In Flow, in a Set Variable action, set the variable value to the result of to arrGods["Sea"], which would be "Neptune". 

 

How does one accomplish this in Flow?

Categories:
I have the same question (0)
  • VictorIvanidze Profile Picture
    13,073 on at

    No way. You have to scan all key elements of array.

  • CantStopTheFlow Profile Picture
    21 on at

    By scan, do you mean do an Apply to Each action until the desired key is found?

  • CantStopTheFlow Profile Picture
    21 on at

    I did this, 

    1. Create a strong-typed array (arrArray):

    [
    { "Domain": "Love", "Owner": "Eros" },
    { "Domain": "Sea", "Owner": "Neptune"} ,
    { "Domain":"Slingblade","Owner":"Billy Bob Thorton"}
    ]

     

    2. Make a Filter Array action

    {
        "inputs": {
            "from""@variables('arrArray')",
            "where""@equals(item()?['Domain'], 'Sea')"
        }
    }
     
    3. Set Variable action
    {
        "inputs": {
            "name""strValue",
            "value""@{outputs('filter_array')['body'][0]['Owner']}"
        }
    }
     
    Now I just need to figure out how to pass in an Array as a parameter, or build it from a text parameter, and then I'll have a global flow to add to my toolbox. 
  • VictorIvanidze Profile Picture
    13,073 on at

    Yes, correct.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard