cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

PowerAutomate and create item in SharePoint list issue

Hello, 

I have the following issue when trying to create a list item with PowerAutomate.

Here are the details:

- I have a SharePoint list with a column called "Site Collection URL" (type: single line of text)

 

SiteCol.png

 

From here I initialize a variable named SiteColURL:

 

InitVar1.png

 

Here comes the error part:

 

In the Create Item action, if I select the Site Address and the List Name, everything works fine:

 

OK1.png

 

But when I try to use the site address from the variable, everything crashes.

 

NOK1.png

 

What can I do to pass the values dynamically?

 

Thanks. 

14 REPLIES 14
Highlighted
Super User II
Super User II

Hi @leolsdn 

 

When you see the "item/...." it means that when you created the Power Automate, you had those columns, and Power Automate mapped them, but at some point, they were removed. But since there are fields present in those columns, Power Automate signals this as "item/...". Can you please check if the schema of that list is updated and map to the current columns?

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

Highlighted
Resident Rockstar
Resident Rockstar

As per my understand( I might be wrong) you cannot pass the SharePoint 'Site Address' in the 'create item' as a dynamic variable(screenshot below). 

 

CFernandes_1-1597229851364.png

 

SharePoint URL is a drop down

 

CFernandes_2-1597229900321.png

 

 

You need to create  logic in your Power Automate solution perhaps using a 'Switch case' and create the item in correct site-collection.

 

I hope it helps.

 

 

Highlighted

Hi 

 

 

 

NOTOK.png

 

 

 

Highlighted

@CFernandes :  then why does create site works and create list item doesn't?

 

createsite.png

 

I agree it's a POST request that doesn't rely much on PowerAutomate....

Highlighted

@leolsdn Just a though 

 

Can you try to 'Create List item' using the SharePoint 'Send an HTTP request to SharePoint' action. Reference - https://www.c-sharpcorner.com/article/sharepoint-rest-api-in-power-automate-ms-flow/

Highlighted

Finally, this is what I did.

Here's the logic:

 

REST1.png

 

Now the only thing that I'm stuck on is how to populate a filed of type: "Person or Group".

The column name appears as: _layouts/15/FldEditEx.aspx?List=%7BE67E4271-5C06-466B-B965-0DBA6B316FB7%7D&Field=Site_x0020_Owner so it should be Site_x0020_Owner.

 

The weird thing is that if I do a REST call from the browser:

 

https://andreir4040.sharepoint.com/sites/NTTDATA1/_api/web/lists/getbytitle('Site%20Index')/Items

 

I don't get this field, but instead Site_x0020_OwnerId of type Edm.Int32 and Site_xx0020_OwnerStringId

 

Could you guys give me some help with populating this field ?

 

Thanks

@CFernandes  and @manuelstgomes 

 

 

 

Highlighted

@leolsdn I see that you are using the REST API approach as I suggested in my previous update.

 

What happens when you try to use the SharePoint Action, 'Get File Properties' action, does that return you the column.

 

CFernandes_0-1597305326406.png

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

Highlighted

@CFernandes : it's a list with no attachments. not a document library. 

Let's not mix things.

 

Any other idea ?

Highlighted

Running out of ideas.

 

The SharePoint HTTP workaround has helped me get across most of the problems but in your case

 

"You mentioned - The weird thing is that if I do a REST call from the browser:  https://andreir4040.sharepoint.com/sites/NTTDATA1/_api/web/lists/getbytitle('Site%20Index')/Items - I don't get this field, but instead Site_x0020_OwnerId of type Edm.Int32 and Site_xx0020_OwnerStringId"

 

This is really getting tricky as you cannot find the field. Maybe the column is corrupted in SharePoint? Can you try deleting the column and recreating it. 

 

Highlighted

Deleted the column, recreated it. Same behavior.

You can only find: 

d:Site_x0020_OwnerId m:null="true" /><d:Site_x0020_OwnerStringId m:null="true" />

 

<d:Site_x0020_OwnerId m:null="true" /><d:Site_x0020_OwnerStringId m:null="true" /></m:properties>

 

Highlighted

@leolsdn Very strange. Can you open a ticket with Office 365 SharePoint Team and show them the problem.

Highlighted

You're kidding 🙂

They will just say it's developer support and close the case.

Trust me, it happens. 

Support for SPO is the worst possible. 

Highlighted

@gamoraes , as you managed to delete the field in this post: https://powerusers.microsoft.com/t5/General-Power-Automate/How-to-clear-SharePoint-quot-Person-or-gr...

Could you help us figure out how to populate the field ?

 

Thanks. 

Highlighted

OK, so researched a bit more:

 

If in the request body you use: 'Site_x0020_OwnerId':6,

 

example:

REST2.png

 

You will basically get the user with ID 6 from the userinfo list of the site (e.g. https://andreir4040.sharepoint.com/sites/NTTDATA2/_catalogs/users/detail.aspx

 

Still did not find a way to inject a UPN there....

 

 

 

 

 

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 (7,794)