web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Need help setting _Mod...
Power Automate
Unanswered

Need help setting _ModerationStatus of Sharepoint Document Library to 0 (Approved)

(0) ShareShare
ReportReport
Posted on by 427

Hello all,

At the end of my Power automate Workflow I'm trying to send a HTTP request to my Sharepoint to set the file that is has been processed by the workflow to Approved (_ModerationStatus). I however get the error it can't find my library. What am I doing wrong?

 

DJanssen_0-1702539969071.pngDJanssen_1-1702539997001.pngDJanssen_2-1702540048775.png

Thank you in advance!

Categories:
I have the same question (0)
  • v-yetonggu-msft Profile Picture
    on at

    Hi @DJanssen ï¼Œ

    vyetonggumsft_0-1702541299663.png

    vyetonggumsft_1-1702541424403.png

    Best Regards,

    Sunshine Gu

     

  • DJanssen Profile Picture
    427 on at

    Hello @v-yetonggu-msft , 

     

    Ah that seems to solve the issue that it cannot find the library. I reran the flow again but now it complains about the JSON body that I send along. I tried adding the spaces to the _metadata property but it still gives me the error about the metadata being wrong:

     

    DJanssen_0-1702543677020.png

     

    The parameter __metadata does not exist in method GetById.

     

     

  • Verified answer
    v-yetonggu-msft Profile Picture
    on at

    Hi @DJanssen ,

    vyetonggumsft_0-1702544606807.png

    Replace type with this expression.

     

    SP.Data.IMS_x0020_Working_x0020_AreaListItem

     

    Best Regards,

    Sunshine Gu

  • DJanssen Profile Picture
    427 on at

    Hello @v-yetonggu-msft ,

     

    Thank you for your suggestions, I'm getting a lot closer to the solution 🙂 I implemented your suggestion but it failed on the first try again:

    DJanssen_0-1702546477360.png


    I then found another useful topic to try changing the POST to PATCH. I think PATCH is more accurate for my situation since the _ModerationStatus before running the workflow on this item is Pending (2). When I tried it with PATCH I got the following error:

    DJanssen_1-1702546566892.png

    Appreciate your thoughts!

    Update:
    I added the header:
    If-Match: * and that fixed the eTag error. Now the error is:

     

    DJanssen_0-1702549091259.png

     

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


    The IMS Working Area is a Document Library. Might this be the problem?

  • DJanssen Profile Picture
    427 on at
    {
     "__metadata": { "type": "SP.Data.IMS_x0020_Working_x0020_AreaItem" },
     "OData__ModerationStatus": 0
    }

    This was the correct way to update it. Happy it works!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard