cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper II
Helper II

How to get ID for sharepoint list in get item action

Hi,

Can anyone help me in getting records from a SharePoint list? I just want to get a single record matching certain criteria but when i use “Get Item” action, it requires ID but i do not know what to populate in that field.
1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User II
Dual Super User II

Hi @Kpreeti1256 

 

Instead of using "Get Item", you can use "Get Items" actions and set a filter OData query to specify a filter criteria. If you just need 1 record, you can set the Top Count as 1.
MicrosoftTeams-image (197).png
If you need more than 1 record and want to iterate over all the returned items, you can use an apply to each loop and execute the "Get Item" action inside the loop as:
MicrosoftTeams-image (198).png

 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

5 REPLIES 5
Advocate I
Advocate I

Hi there, 

there are extra steps before "Get Item"

  1. use "Get Items" on the list you can filter list with your condition - expand Show advanced options
    instead of filtering on the list itself you can add additional step "Filter Array" with your conditions
  2. Set variable for your item - you will need to use 
    first(body('Filter_array'))
    expression on the output created from either Get Items or Filter Array - otherwise when you try to get ID the action will go into Apply to Each 
  3. Parse Json of the item to get info
  4. do what you need to do with item

Image below I am pulling in files use Get Items instead of Get Files 

 

  1. FilterDoc.png
Dual Super User II
Dual Super User II

Hi @Kpreeti1256 

 

Instead of using "Get Item", you can use "Get Items" actions and set a filter OData query to specify a filter criteria. If you just need 1 record, you can set the Top Count as 1.
MicrosoftTeams-image (197).png
If you need more than 1 record and want to iterate over all the returned items, you can use an apply to each loop and execute the "Get Item" action inside the loop as:
MicrosoftTeams-image (198).png

 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

Dual Super User III
Dual Super User III

To get a specific item from a list that matches a certain criteria use the Get Items action and supply an OData query to filter the results down to the one record you want. Here's a Blog post that explains how to get Items with an Odata query.

http://toddbaginski.com/blog/use-dynamic-odata-filter-values-in-a-microsoft-flow-sharepoint-getitems...



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Community Support
Community Support

 

Hi @Kpreeti1256  were the suggestions above able to help you with your issue?

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @yashag2255 

 

Thanks for the help. This worked like a charm!

Helpful resources

Announcements
New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (39,064)