Setting a Retention Label in SharePoint from Microsoft Flow

Reading Time: 2 minutes

As time goes on, more capabilities are being introduced to automatically set a retention label on a document rather than having to rely on the end-user to manually set it. As of this date, options include defaulting a retention label at a document library level, folder level, or auto-applying based on either a queryable managed property or a content type.

There still may be times when you need to set a retention label based on a more complex set of conditions not falling into any of the above categories. On the Content Services Roadmap shared at Ignite 2018, there was mention of an action in Microsoft Flow to set a Retention label at a Later time. (red star)

Roadmap - Content Services

Until then, here is how you can set a retention label using a Send an HTTP Request to SharePoint action in Microsoft Flow: (this example is for a non-record label)
Flow Action

Eventually, this capability will be available as an action in Microsoft Flow. Until that time, this is how you can do it. Note: I haven’t tested all of the above property settings for record and event-based labels.

Thanks for reading!


Image by LUM3N from Pixabay


  1. Joanne,
    Thanks for this wonderful tip. You mentioned in the post that currently options exist to apply default labels to libraries and folders. I am able to find the option to apply the label defaults to libraries but cannot find any option to apply labels automatically to folders inside a library. Is there a specific setting or trick I need to utilize to apply a default label to a folder?

    1. If you set the retention label on the folder thru the UI… detail pane… The documents within will get the label. There are some exceptions but that’s the main behavior.

  2. I am wanting to replicate your demo but am running into issues with the ID that I should use. Do you have a complete walk through you can share?

    1. Hi Douglas,
      You need to first get the document you want to apply the retention label on, and use that document’s Id when setting the retention label.

  3. This is perfect, I have been struggling to find a solution to set labels based on metadata for my client that didn’t involve an E5 license or 3rd party solution and this works perfectly…

    when I asked Microsoft about RESTful or CSOM options they told me none existed, I guess they prefer people to purchase E5 licenses.

  4. Hello Joanne,

    Your article gave me a start towards my solution, but I am stuck here:

    In my case, I have retention labels that I am going going to apply to the documents. So, the document expiry would happen based on the expiry date that Retention label carries.

    [example:- Doc A has 1 year retention label. so, 10 days prior to that the author/owner of that document should receive the notification]

    How can I achieve this notification/trigger depending on the Retention label expiry.

    Thanks in advance

    1. Hi Gurujyot,
      I don’t have enough information to completely answer your question. Do you have a disposition review configured on your retention label definition? If so, the notification doesn’t happen 10 days prior to the disposition date, It is controlled by a back-end process that runs once per week so the notifications will be sent out up to 7 days after expiry. You don’t control that part. If you just have a retention label and you’re controlling the notification yourself, you’d have to know the expiry date, I’ve never seen how to get that but presumably you could get it thru an API call,

  5. Thanks @Joanne

    Do you have some helpful article that can help me out? Articles that I can use to call API through SPO.(I haven’t done this in past)

  6. Apologies to resurrect an old thread, but does anything know if it’s possible to apply Retention Labels to Items within a SharePoint List using a Flow? Thank you

  7. Hey Joanne, is there an equivalent option in the REST API for updating a sensitivity label?

    Thank you in advance!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.