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 / Update custom property...
Power Automate
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

Categories:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,189 Most Valuable Professional on at

    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

  • Andreas_K Profile Picture
    2 on at

    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

  • saul26 Profile Picture
    2 on at

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

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 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard