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 / Get Item ID via filter?
Power Automate
Unanswered

Get Item ID via filter?

(0) ShareShare
ReportReport
Posted on by 41

I am working with 2 sharepoint lists. Both lists contain a reference column that has an identical value to keep the 2 respective records associated with eachother.

 

The first one is when item or file modified > get items

The second sharepoint list I need to get 2 values from a specific record. Since I don't have the ID, I am hoping theres a solution like (lookup(sharepointlist2, reference = $reference)).ID where $reference is the value of reference column mentioned above.

 

I see solutions saying use get-items but I intend to only get a single item. I don't want to add extra "apply to each" steps to drop out of the object just to get to the values. That feels... unelegant

Categories:
I have the same question (0)
  • Verified answer
    abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Hi @stevenbaron86 

     

    If you don't have the id then you need to use the Get items filter query where you can set the reference column name  eq matching value you looking for. Since its a List item then it always going to have one or more records. Yes in your case if that value is unique and have only one record still its going to add a loop to iterate the value. If you don't want the loop then you could use expression to get the id without using the apply to each loop using an hardcoded index 0 as only one record.

     

    image.png

     

    Above expression is as follows:

     

    body('Get_items')['value'][0]['id']

     

    Note: It always expect the matching value otherwise this will result in an error. You could add another IF expression to evaluate if record exists or not to avoid the error.

     

    Thanks 

  • stevenbaron86 Profile Picture
    41 on at

    Thanks for the fast response. This did generate the values I was looking for for one. How about a nested object? Specificially I am looking for the DisplayName property of a people picker.

     

    body('Get_items')['value'][0]['HiringManager'] is the syntax I used.

     

    {
    "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
    "Claims": [removed]
    "DisplayName": [removed]
    "Email": [removed]
    "Picture": [removed]
    "Department": null,
    "JobTitle": null
    }

  • Verified answer
    abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Try

     

    body('Get_items')['value'][0]['HiringManager']['DisplayName']

     

  • stevenbaron86 Profile Picture
    41 on at

    Works my dude you are excellent. How can I learn more about the syntax you are using for this?

  • abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Hi @stevenbaron86 

     

    Thanks a lot. Just experience and learn more about JSON data and Power Automate Expressions. At the end of the day all data are transferred as JSON format. So its more important to learn about JSON.

     

    Reference guide for functions in expressions - Azure Logic Apps | Microsoft Docs

     

    I also have a YouTube channel which explains couple of techniques.

     

    https://www.youtube.com/channel/UC3Hscto0sm7Oh3u08o0RDzg

     

    Thanks

    Thanks 

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard