cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Dave_31415
Level: Powered On

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
Community Support Team
Community Support Team

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

 

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
Dual Super User
Dual Super User

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

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

Community Support Team
Community Support Team

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

 

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
firstImage

New Ranks and Rank Icons in April

Read the announcement for more information!

firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,865)