cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Send HTTP Request to Sharepoint - The expression is not valid

I'm trying to create a simple Send an HTTP request to Sharepoint to update a value in a column.

Here is a sample of my list.

rrogerson_3-1603049766622.png

 

And here is the very basic flow

rrogerson_4-1603049827059.png

 

When I test the Flow I get an HTTP 400 error

rrogerson_5-1603049876641.png

 

 

I've tried to solve this myself by checking other solutions to similar problems but I can't get it to work so I'm asking the community.

 

Thanks,

 

Rob

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

@rrogerson - glad to hear that you were able to make some progress. That's a good reference and I use it all the times. You can't pass custom list column value, like in your case the employee number. Insert "Get Items" action before HTTP request action and use filter to filter the results (EmpNo eq '000020') then use the Id returned from "Get items" in HTTP request action. Give that a try and let me know if you need any further help.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Thanks

 

 

 

View solution in original post

4 REPLIES 4
Highlighted
Responsive Resident
Responsive Resident

Hi @rrogerson  - couple of things.. when you are constructing the Uri you need to use list item id in "items()" (number field) and also update Content-Type header as below and delete Accept. Below please find a screen capture from my testing.

 

PowerAutomate-SendHTTPRequestPatch.png

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Thanks

Highlighted

@UdayAdhikari , Thanks, that worked.  I changed the "items()" and the Content-Type in the header as you suggested.  Great.

 

But I'm a little confused.  From my example above how do I change a specific employee.  For example, I want to change the first name of employee number 000020 to Mike.  On the uri if I change this to _api/web/lists/GetByTitle('Employee')/items(2) the Flow will work.  But how do I specify the employee number ('000020') I want to change rather than the row id (2).

 

Also, I've been referring to (https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/working-with-lists-and-list-items-with-re... 

POST https://{site_url}/_api/web/lists/GetByTitle('Test')/items({item_id})
Authorization: "Bearer " + accessToken
Accept: "application/json;odata=verbose"
Content-Type: "application/json"
Content-Length: {length of request body as integer}
If-Match: "{etag or *}"
X-HTTP-Method: "MERGE"
X-RequestDigest: "{form_digest_value}"

{
"__metadata": {
"type": "SP.Data.TestListItem"
},

"Title": "TestUpdated"
}

 

Which doesn't agree with what you showed me works.  Am I referring to the wrong docs?

 

Thanks,

 

Rob

Highlighted

@rrogerson - glad to hear that you were able to make some progress. That's a good reference and I use it all the times. You can't pass custom list column value, like in your case the employee number. Insert "Get Items" action before HTTP request action and use filter to filter the results (EmpNo eq '000020') then use the Id returned from "Get items" in HTTP request action. Give that a try and let me know if you need any further help.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Thanks

 

 

 

View solution in original post

Highlighted

Thanks @UdayAdhikari ,

 

Following your advise here is what I got to work as I desired.

rrogerson_0-1603162371812.png

rrogerson_1-1603162453427.png

rrogerson_2-1603162557820.png

Thanks again,

 

Rob

 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Users online (9,727)