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

Problems updating file properties with http request to SharePoint

Hi all.

 

I have build several approval flows on document libraries, but have the problem that, the documents can be locked for updating it they are opened when the flow wants to update the metadata.

 

I have read an article about using the http request for SharePoint, and have been trying to use this, but with no luck. I am very new to this, and a no code guy, so I hope you forgive me if it turns out to be a newbee error.

 

The flow runs perfect until, the http request. I want to update two SharePoint fields, that gets data from to variables.

 

HttpFlow01.PNG

 

 

As I can see it is in the body I get something wrong. i have read this articel, but still cannot get it to work:

Working with lists and list items with REST 

 

When the flow has been running I get the data I want in the body, but are not able to get it to update the SharePoint fields. I would be very happy for any kind of advice to solve this problem.

 

FttpFlow02.PNG

 

/Frank

Denmark

1 ACCEPTED SOLUTION

Accepted Solutions
AKRogers
Level 8

Re: Problems updating file properties with http request to SharePoint

Hi again,

 

This is going to sound simple, but you have a leading space next to SP.Data.DocumentsItem.  I created my own test and tried it out to see if a leading whitespace would really throw that error, and I was able to replicate that issue.  Try removing the whitespace and run the Flow again!

 

Here is my successful HTTP PATCH action:

8.png

 

View solution in original post

10 REPLIES 10
Community Support Team
Community Support Team

Re: Problems updating file properties with http request to SharePoint

Hi @venseben ,

 

Could you please share more details about the error message when the flow runs?

 

Best regards,

Alice       

 

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

AKRogers
Level 8

Re: Problems updating file properties with http request to SharePoint

Hi @venseben,

 

Can you screenshot the error message that you get from the HTTP action?  I'm also assuming the Response variable you have comes from a previous approval step.  What data type is the "Status" column?  If Status is a choice column you may have issues there.

 

Thanks!

Ashley

venseben
Level: Powered On

Re: Problems updating file properties with http request to SharePoint

 

Hi @v-alzhan-msft and @AKRogers Thx for quick replys. I will try to provide you with some screenshots and further details: It is a standad approval flow for a selected item in a SharePoint library.FlowError01.PNG

 

FlowError02.PNG

 

FlowError04.PNG

 

FlowError05.PNG

 

When i check out the history of the flow, the outcome is matching the condition, and the flow is going in the right direction, but failes, with this error message:

 

A type named ' SP.Data.Documents' could not be resolved by the model. When a model is available, each type name must resolve to a valid type.

 

The "Status" field in the SharePoint library is a text field, and the "Godkendt" field is a date field.

 

Hope this can make any snece to you 🙂

 

/Frank

Denmark

AKRogers
Level 8

Re: Problems updating file properties with http request to SharePoint

Hi again!

Each list or library has its own specific type of SP.Data, and it looks like SP.Data.Documents is incorrect in this case.
Add an HTTP to SharePoint action and give it a GET method. Point it to your “Documents” Library and then run your Flow. If you inspect the body of data that comes back you should be able to see the correct SP.Data in there; use that in your MERGE action instead.
Note that the internal name of the default Documents library is “Shared Documents,” so this is potentially where the issue is.

Take care!
Ashley
venseben
Level: Powered On

Re: Problems updating file properties with http request to SharePoint

Hi @AKRogers. The library is named "Documents", it is a new library, and not the standard shared%20documents library, so the name shoud be correct. I have just done a test with the Get method that you mentioned, an the flow was running just fine. I did get a list guid in return, so i will try that and see how the flow turns out. I also got the type back and it is "SP.Data.DocumentsItem", so maybe that is also the root cause. I will do some testing and return back to you.

 

THX a 1000 times for the tip with trying the Get method.

 

/Frank

AKRogers
Level 8

Re: Problems updating file properties with http request to SharePoint

You’re very welcome! Keep us updated!

Ashley

If you liked my responses, consider giving a thumbs up!
If my response answered your question, please mark it as a solution so that others can easily find it!
venseben
Level: Powered On

Re: Problems updating file properties with http request to SharePoint

Hi @AKRogers. Still get the error Smiley Sad

 

I have tried to insert the guid, but that did not helped, and I have tried to insert the type, and taht did not help either

I still get the same error that there is something with the model. See the error status below.

FlowError01.PNG

/Frank

Denmaerk

AKRogers
Level 8

Re: Problems updating file properties with http request to SharePoint

Hi again,

 

This is going to sound simple, but you have a leading space next to SP.Data.DocumentsItem.  I created my own test and tried it out to see if a leading whitespace would really throw that error, and I was able to replicate that issue.  Try removing the whitespace and run the Flow again!

 

Here is my successful HTTP PATCH action:

8.png

 

View solution in original post

venseben
Level: Powered On

Re: Problems updating file properties with http request to SharePoint

@AKRogers - you are GOD to me!!!! I bow to you

 

/Frank

AKRogers
Level 8

Re: Problems updating file properties with http request to SharePoint

Haha, my pleasure! Happy Flowing!

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Speakers, submit your sessions now! Call for speakers ends Feb. 10!

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!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (5,364)