cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Dave_31415
Frequent Visitor

Send HTTP to Sharepoint and Select from JSON - Bad Request Array error

Hello,

 

I have the following MS Flow:

 

Sharepoint List > "When an item is created or modified"  [This works]

Sharepoint > "Send an HTTP request to Sharepoint" [This works]

  • Site address is correct
  • Method:  GET
  • Uri:  _api/web/Lists/getbytitle('MyList')/items(@{triggerBody()?['ID']})/versions?$top=2
  • Headers: key= accept   value=application/json; odata=nometadata  
  • Body:  

Select [This fails]

  • From: @{body('Send_an_HTTP_request_to_SharePoint')}
  • Map:
    • key= ID  , value=  @triggerBody()?['ID']
    • key= Status, value= @triggerBody()?['Status']?['Value']
    • key= Version, value= @triggerBody()?['{VersionNumber}']

Fail= BadRequest. The 'from' property value in the 'select' action inputs is of type 'Object'. The value must be an array.

 

My problem:  I don't know how to fix this Bad Request error. This is my first time trying to use a send http request in sharepoint flow like this. 

 

My goal: I want to check last two version to see if the modified field was the Status or not. If it was the Status, then I will use a Switch statement to evaluate the Status change and take appropriate action. 

 

I would appreciate it greatly if someone has a solution to fix this flow or an alternative method that accomplishes the same goal. 

 

Thank you very much.

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-bacao-msft
Community Support
Community Support

 

Hi @Dave_31415 ,

 

Please refer to this blog for details on obtaining item versions using an HTTP request:

Check-for-a-Change-in-a-SharePoint-List-Column-Value

It is recommended to parse the response using Parse JSON action, which makes it easy to get specific property values.

Please try again.

 

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.

View solution in original post

2 REPLIES 2
RezaDorrani
Dual Super User II
Dual Super User II

Hi @Dave_31415 

 

Use

 body('Send_an_HTTP_request_to_SharePoint')?['d']?['results']

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

v-bacao-msft
Community Support
Community Support

 

Hi @Dave_31415 ,

 

Please refer to this blog for details on obtaining item versions using an HTTP request:

Check-for-a-Change-in-a-SharePoint-List-Column-Value

It is recommended to parse the response using Parse JSON action, which makes it easy to get specific property values.

Please try again.

 

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.

View solution in original post

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.

Top Solution Authors
Users online (1,837)