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.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

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

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Users online (2,283)