Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

Lookup a value in power automate

(0) ShareShare
ReportReport
Posted on by 39

Hi,

I have a flow that gets data via an HTTP step.
The output includes several fields where my interest is in two fields: URL, and group ID:

Moshema_0-1667199923933.png

 


I have an excel and in the excel I have a column with the URL.

Moshema_1-1667199981615.png

 

I want to check in the JSON the URL from excel and if it finds it to receive the group ID and if not to do something else.

I'll really appreciate it if someone can help me.



  • Verified answer
    grantjenkins Profile Picture
    11,059 Super User 2025 Season 1 on at
    Re: Lookup a value in power automate

    The Filter array will contain all the properties from your JSON including the groupId.

  • Moshema Profile Picture
    39 on at
    Re: Lookup a value in power automate

    @grantjenkins  amazing, thank you.

     

    Just a little question from where do you take the group ID

    in 

    first(body('Filter_array'))?['groupId']
  • Verified answer
    grantjenkins Profile Picture
    11,059 Super User 2025 Season 1 on at
    Re: Lookup a value in power automate

    I'd suggest using a Filter array on the locations array in your JSON.

     

    In my example I've assumed you are looping over each of the rows in your Excel file.

     

    See my example below. I'll go into each of the actions.

    grantjenkins_1-1667202348691.png

     

    Compose just contains a sample of your data you retrieve from HTTP. And Parse JSON gets me nice properties I can refer to. You can skip these steps as you already have your data.

    grantjenkins_2-1667202819432.png

     

    List rows present in a table gets my Excel data.

    grantjenkins_3-1667202860907.png

    My Excel data for this example has the following:

    grantjenkins_4-1667202900209.png

     

    Next, I use an Apply to each to iterate over each of the rows from Excel. I then have a Filter array that takes in the locations array from my Parse JSON action and filter on url is equal to Location (from the current row)

    grantjenkins_5-1667203009020.png

     

    This will return a filtered array of objects where the url matched. We can then use a Condition to check if the length of the Filter array is greater than 1, and apply the appropriate actions for true or false.

     

    The expression to get the length of the array is:

    length(body('Filter_array'))

     

    grantjenkins_6-1667203195750.png

     

    If you then wanted to extract out the group Id from the Filter array you could use a first expression as we assume it's only returned a single result, but still an array.

    first(body('Filter_array'))?['groupId']

    grantjenkins_8-1667203342233.png

     

    Hope that helps and is what you were after.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow