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

SP get item for specific item

Hey,

 

I'm rather new to Power Automate, and using it with SP, so here goes. I have a list full of entries, and a view which limits it to only the items I want to see. What I now want to do is for flow to give me the first entry in that view when I press a button in my PowerApps app, and hand that item back to my PowerApps app. For this purpose I thought I could use SP get Item, just hand it the list and view, and set the *Id to 0 or 1 (not sure if Power Automate iterates from 0 or 1), but alas, no such luck, and I end up getting an error of the type:

failed:{"error":{"code":502."source":"europe-001.azure-apim.net","clientRequestId":"62fa226d-a9a5-4e68-c40e3e9d628f","message":"BadGateway","innerError":{"code":"NoResponse","message":"The server did not received a responce from an uppstream server. Request tracking id '08586098971154059502951552601CU72'."}}}}

and I suspect it is because I enter the wrong *Id and it can't find anything with that *Id. Perhaps my problem is "worse"/"deeper" than I think, but yes.

 

in advance thanks 😄

2 ACCEPTED SOLUTIONS

Accepted Solutions
ScottShearer
Super User
Super User

@Mats_1997 

You can't use views to limit the items returned to a Flow.  The view setting in Get items only serves to limit the columns returned - not the rows. 

Was you view filtering the rows?  If so, you'll likely need to use a filter query and a Get Items action.  Here is a link to more info on using OData filters.

 

 

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

Scott

View solution in original post

@Mats_1997 

You can use Get item if you have the correct ID. The action wants the ID of the specific list item and this has nothing to do with the view. 

My point is that using a view while in SharePoint will limit the columns and may/may not filter the rows.  You can choose to filter the rows returned or not.  Power Automate does not use SharePoint views to filter rows.  It only looks at the view to see what columns have been selected and returns only those columns.  Selecting a view in Get items is optional.

You said that you wanted to return the first item in a view - you can't do that without using a Get items action and using an OData filer - i.e. replicating the filter in the view.  You'll also want to set the top count to 1 and set the sort order to be the same as the view.

 

 

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

Scott

View solution in original post

4 REPLIES 4
ScottShearer
Super User
Super User

@Mats_1997 

You can't use views to limit the items returned to a Flow.  The view setting in Get items only serves to limit the columns returned - not the rows. 

Was you view filtering the rows?  If so, you'll likely need to use a filter query and a Get Items action.  Here is a link to more info on using OData filters.

 

 

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

Scott

@ScottShearer Really? but it knows about my SP views, which only limits rows, not columns, so you're telling me that giving the get item/items functions a view is completely useless? furthermore then what is really the function of the Get Item function if it does not does, as the name implies, get one specific item from a SP list??

 

I'm rather confused

@Mats_1997 

You can use Get item if you have the correct ID. The action wants the ID of the specific list item and this has nothing to do with the view. 

My point is that using a view while in SharePoint will limit the columns and may/may not filter the rows.  You can choose to filter the rows returned or not.  Power Automate does not use SharePoint views to filter rows.  It only looks at the view to see what columns have been selected and returns only those columns.  Selecting a view in Get items is optional.

You said that you wanted to return the first item in a view - you can't do that without using a Get items action and using an OData filer - i.e. replicating the filter in the view.  You'll also want to set the top count to 1 and set the sort order to be the same as the view.

 

 

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

Scott

@Mats_1997 Selecting a view in Get items is to help a situation where a list might have hundreds of columns. If Power Automate had to bring all that lot back it would have a serious impact on performance. You can resolve that by limiting the columns in the view and then selecting that view.

Rob
Los Gallardos

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (2,543)