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

Create Lookup column in SharePoint list using the HTTP Request to Sharepoint

Hi Everyone,

 

I'm trying to add a lookup column to an existing Sharepoint List (allowing multiple values), using Power Automate (HTTP Request to Sharepoint).

 

I was able to add a 'simple' type column following the solution of this post: https://powerusers.microsoft.com/t5/Building-Flows/Create-a-new-column-in-SharePoint-list-from-Flow/...

 

I read the Fields REST API Documentation (https://docs.microsoft.com/en-us/previous-versions/office/developer/sharepoint-rest-reference/dn6001...) and tried to follow the instruction, but, inspite multiple attempts, I wasn't able to make it work for a Lookup Column Type.

 

Here are some screenshots of the attempted flows:

 

Capture.PNG

In this case the flow keeps running for minutes without stopping, but seems like it´s a BadGateway error. Even without the "LookupWebId" and "AllowMultipleValues" in the Body, the flow didn´t work.

 

Capture.PNG

 

In this case the flow doesn´t even start and I get this error: 


"An entry without a type name was found, but no expected type was specified. To allow entries without type information, the expected type must also be specified when the model is specified."

Thank you in advance for your help!

Regards,

Saul

 

13 REPLIES 13
v-litu-msft
Community Support
Community Support

Hi @saul89,

 

Please look at this document, maybe it will help you:

https://docs.microsoft.com/en-us/previous-versions/office/sharepoint-visio/jj245299%28v%3doffice.15%...

 

This is the Blog that how to find the GUID of the column:

https://kennekro.net/2017/02/find-guid-of-list-column-in-sharepoint/

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Cmac474
Advocate I
Advocate I

I'm currently facing the same issue - did you ever resolve this?

saul89
Frequent Visitor

Unfortunately not 😞

This will work - but you need to know the GUID of the of the list you are looking up

 

Screen Shot 2020-05-08 at 4.21.51 PM.png

CarlHRVA
Continued Contributor
Continued Contributor

@Cmac474 wondering if you could tell me what I'm doing wrong here. I'm getting the following error:

 
An entry without a type name was found, but no expected type was specified. To allow entries without type information, the expected type must also be specified when the model is specified.
 
The body of my HTTP request looks like this:
{
'parameters': {
'__metadata': {
'type': 'SP.FieldCreationInformation'},
'FieldTypeKind': 7,
'Title': 'Hotel Name',
'LookupListId': '{static GUID for lookup list here}',
'LookupFieldName': 'Title'
}
}
 
This would be immensely helpful if I could get it to work. Thanks in advance for any advice you can give!
 
CarlHRVA
Continued Contributor
Continued Contributor

Figured it out looking at another post. I didn't have the correct headers for my request and I was missing  "/addfield" in the Uri, once added it worked perfectly.

 

CarlHRVA_0-1595287982075.png

 

Just got to this now, glad you figured it out 🙂

AnouckFierens
Frequent Visitor

I tried everything that was placed in this post but I keep on receiving the error: 

Incorrectly formatted json stream. clientRequestId: 2164ceae-6e26-4930-a7b3-319ef1fe6368 serviceRequestId: 778edf9f-c0f7-3000-0da3-62988f3ee026

 

Screenshot_1.jpg 

 

Am I doing something wrong?

SmoothOperator
Advocate I
Advocate I

I am currently looking for a solution in creating a LookUp column from Power Automate and tried maaany solutions found online; alongside with experimentation, I have not actually manage to do this. 

Can anyone add up to this?

Cmac474
Advocate I
Advocate I

I just ran this test again and it works

 

SIte Address

 

Method = Post

 

URI = _api/lists/getbytitle('LISTNAME')/fields/addfield

 

Headers = accept application/json;odata=verbose

                  content-type application/json;odata=verbose

 

body = 

Screen Shot 2021-09-02 at 9.51.38 AM.png{
'parameters': {
'__metadata': {
'type': 'SP.FieldCreationInformation'},
'FieldTypeKind': 7,
'Title': 'Name of Column you want to create',
'LookupListId': '{GUID of the list you want to look up - remove the %7B and %7D }',
'LookupFieldName': 'Field you want to lookup'
}
}

I just tried this again and for me this isn't working.

Hi @Cmac474 ,

 

Can you tell me how to get GUID and also View ID for  the particular list.

 

Thanks in Advance

Cmac474
Advocate I
Advocate I

You have to go to the list and then open the settings for the list and it will be at the end of the URL  List=%7B'ListID'%7D

*edit (didn't see the view id part)

 

while in settings, scroll down to views and click on the one in question - same as above, except View=

Helpful resources

Announcements
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.

New Process Advisor Capabilities carousel.png

Read the blog for the latest news

Read the latest about new experiences and capabilities in the Power Automate product blog.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

AI Builder AMA June 7th carousel (up on May 25th, take down June 8th) (1).png

'Ask Microsoft Anything' about AI Builder!

The AI Builder team invite you to ask questions and provide helpful answers at our next AMA.

Users online (1,544)