cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
darrenfloyd666
Post Prodigy
Post Prodigy

REST API in 'Send a HTTP Request' returning an error

Hi

 

I'm trying to return an additional SP column in a Flow I've inherited. I've checked the name of the field in the address bar and it's showing as 'BTG%5Fx0020%5FPolicy%5Fx0020%5FOwner'. I've added it to the Uri but I'm getting the following error:

 

The query to field 'BTG_x0020_Policy_x0020_Owner' is not valid. The $select query string must specify the target fields and the $expand query string must contains BTG_x0020_Policy_x0020_Owner.
clientRequestId: 7a8296bc-5ebc-46cc-bb70-91bcc63de8b0
serviceRequestId: 6197499f-500b-a000-9d7a-15393aae9596

 

The field in SP is a 'People Picker' field. I'm also figuring out how the script works after $filter.

 

Any help appreciated!

 

HTTPRequest.png 

1 ACCEPTED SOLUTION

Accepted Solutions

Hello @darrenfloyd666 

A little correction to $select and $expand 🙂

... $select=BTG_x0020_Policy_x0020_Owner/Title,Policy_x0020_Expiry&$expand=BTG_x0020_Policy_x0020_Owner ...

Kind regards, John

View solution in original post

6 REPLIES 6
JohnAageAnderse
Memorable Member
Memorable Member

Hello @darrenfloyd666 

Did you find an answer to your question?

As you wronte the  'BTG_x0020_Policy_x0020_Owner'  is a people field, so you have to get the value from it using both $select= ... and $expand= ...

In both places you have to use the BTG_x0020_Policy_x0020_Owner/title - this should give you the value of the field.

Unsure if title after the slash is correct, else you will have to search for this information 🙂

Hope this helps a little. Kind regards, John

Thanks @JohnAageAnderse added the column to the select:

RESTThursday.png

 

and I'm getting the following error: 

 

The query to field  is not valid. The $select query string must specify the target fields and the $expand query string must contains BTG_x0020_Policy_x0020_Owner.  

 

Which I've Googled and I'm not getting much luck.
 

Hello @darrenfloyd666 

You are nearly there 🙂

The select and expand should look like this example, where I use the Author column in my list:

?$select=Author/Title&$expand=Author

 

Select states what to get, in the above it is the Authors title aka name. Select can only get it, because Expand helps providing the additional information.

Kind regards, John

darrenfloyd666
Post Prodigy
Post Prodigy

Thanks @JohnAageAnderse , I think I'm close! I'm getting a different error message!

 

Is it because of the '/'  after the expand? 

 

 


_api/web/lists/getbytitle('BTG Documents')/items?$select=Title/BTG_x0020_Policy_x0020_Owner,Policy_x0020_Expiry&$expand=Title/BTG_x0020_Policy_x0020_Owner&$filter=Policy_x0020_Expiry lt datetime'

Error: The field or property 'Title' does not exist

 

 

Hello @darrenfloyd666 

A little correction to $select and $expand 🙂

... $select=BTG_x0020_Policy_x0020_Owner/Title,Policy_x0020_Expiry&$expand=BTG_x0020_Policy_x0020_Owner ...

Kind regards, John

View solution in original post

Brilliant! That worked! Thanks!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (2,932)