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

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
Highlighted

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
Highlighted
Community Support
Community Support

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.

Highlighted
Helper V
Helper V

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

Highlighted

 

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

Highlighted

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
Highlighted

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

Highlighted

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!
Highlighted

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

Highlighted

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

Highlighted

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

 

/Frank

Highlighted

Haha, my pleasure! Happy Flowing!

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 (12,041)