Hi,
I'm struggling to get the correct syntax to update the value of a lookup column of a file in a document library. I've looked at this post (and the article that it points to):
However, there's still quite a difference between the syntax needed here and that for the 'Send an HTTP request to SharePoint' action in Power Automate. I've tried a syntax which just adds the string 'Id' to the end of the lookup column name and sets it through POST request:
However, it throws this error:
Would someone please be able to help me out with this?
Thanks
Yeah I actually stumbled upon that blog post as well when looking for a solution. I just ran into the problem that I was getting the Id's dynamically based on other inputs from the beginning of the flow, so it was hard to switch from array to string and add the ;# to the end of each Id except the last one.
{ "__metadata": { "type": "@{outputs('Send_an_HTTP_request_to_SharePoint')?['body/ListItemEntityTypeFullName']}" }, "Doc_ContentId": {"results": [1,2] } }
This solution worked perfect for me and after results: I put the array of id's.
I have actually also found another solution to my specific problem (I just now realised that this post is about editing a multiple-lookup-column in a document library. I was looking for a solution for a sharepoint list): it doesnt need a syntax as complicated as this. Here is the link: How to update multiple lookup SharePoint column with Power Automate (tomriha.com)
These are screenshot from that website, which held the answer.
You are awesome, was having the same issue and was trying for a day to figure it out. This comment got it working first try!!
Hi @raflderaf,
Normally the value of the type field is something like SP.Data.<NameOfListEncoded>ListItem. In your case it is probably SP.Data.DocsListItem
In my example I dynamically retrieved the type value from another Send an HTTP request to SharePoint action. In that case I used the below.
Read more about that approach in one of my blogs: https://www.expiscornovus.com/2021/07/10/listitementitytypefullname-within-power-automate/
And what do I have to replace this with if I want to apply this to my (Multi) lookup Column "DocsToProduct" in my List "Products" which looks up Multiple items in the List "Docs" (Docs-Item IDs: [71,68]) :
@{outputs('Send_an_HTTP_request_to_SharePoint')?['body/ListItemEntityTypeFullName']}
I dont really see it from this...
Hi @SvampK,
Try this for the body of a multi-lookup field. Keep in mind that the name of the column in this example is Doc_Content and the Id part is added to the end of it.
{
"__metadata": {
"type": "@{outputs('Send_an_HTTP_request_to_SharePoint')?['body/ListItemEntityTypeFullName']}"
},
"Doc_ContentId": {"results": [1,2] }
}
Hi !@Expiscornovus
Facing some similar problem, although is a multiple value lookup column,
have been googled around but couldn't really find the answer. I wonder if you can answer me?
Hi @mjensen98,
Is it a single lookup or do you allow multiple lookup values?
If it is a single lookup you could use this approach:
URI
_api/web/lists/getbytitle('@{variables('ListName')}')/Items(1)
Headers
{
"Content-Type": "application/json;odata=verbose",
"Accept": "application/json;odata=verbose",
"IF-MATCH": "*",
"X-HTTP-Method": "MERGE"
}
Body
{
"__metadata": {
"type": "@{outputs('Send_an_HTTP_request_to_SharePoint')?['body/ListItemEntityTypeFullName']}"
},
"Doc_ContentId": 1
}
Michael E. Gernaey
566
Super User 2025 Season 1
David_MA
516
Super User 2025 Season 1
stampcoin
492