Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Update custom property bag value of the site collection

(0) ShareShare
ReportReport
Posted on by 2

Hi there,

 

i would be glad, if someone can help me in the following case:

 

I have an rentention policy for a site collection working. In the property bag of these site collection i can find values for the properties "closeDate" and "deleteDate", which comes with this policy.

I try to find a solution for updating the "closeDate" value with a flow.

 

Any ideas or suggestions please :)!?

 

Thanks for any help.

Andreas

  • saul26 Profile Picture
    2 on at
    Re: Update custom property bag value of the site collection

    Thank you @Expiscornovus, it worked! Do you know if it is also possible to set the new property as indexed using Power Automate?

  • Andreas_K Profile Picture
    2 on at
    Re: Update custom property bag value of the site collection

    Thanks for your answer, Expiscornovus.

    Unfortunatly I had not the time for testing it. But on the first view it looks great.

    I let you know if it works for me 😉

    Greetings

     

    Andreas

  • Expiscornovus Profile Picture
    31,758 Most Valuable Professional on at
    Re: Update custom property bag value of the site collection

    Hi @Andreas_K,

     

    I assume the DenyAddAndCustomizePages setting is disabled on the site. If not, you have to disable that first.

     

    If that is the case you could use the CSOM XML, shared by tavikukko over here:

    https://github.com/pnp/pnpjs/issues/2067

     

    Below is an example of how to update the rootweb of a site collection using such a POST request

    In this example I am updating a property called customDepartment to a value IT.

     

    Uri

    _vti_bin/client.svc/ProcessQuery

     

    Headers

    {
     "Accept": "*/*",
     "Content-Type": "text/xml;charset=\"UTF-8\"",
     "X-Requested-With": "XMLHTTPRequest"
    }

     

    Body

    <Request xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="MyApplicationName">
     <Actions>
     <Method Name="SetFieldValue" Id="9" ObjectPathId="4">
     <Parameters>
     <Parameter Type="String">customDepartment</Parameter>
     <Parameter Type="String">IT</Parameter>
     </Parameters>
     </Method>
     <Method Name="Update" Id="10" ObjectPathId="2" />
     </Actions>
     <ObjectPaths>
     <Identity Id="2" Name="740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:@{variables('SiteId')}:web:@{variables('WebId')}" />
     <Property Id="4" ParentId="2" Name="AllProperties" />
     </ObjectPaths>
     </Request>

     

     updatepropertybag_web.png

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 566 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 516 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 492