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 / Generating an expiry d...
Power Automate
Answered

Generating an expiry date when a file is created/modified

(0) ShareShare
ReportReport
Posted on by 14
Hello, I'm very new to power automate and I have been scouring the internet to find an answer or documentation to help me understand how to achieve my goal but I'm lost, the responses are far too generic.
 
So here goes. 
 
In the document section of a sharepoint page, I have created a column called "Expiry Date". This column is formatted to a date.
 
When a file is added/modified to a folder and/or specific folder, I would like to populate the expiry date of the file with the file creation/modification date + 4 months for example.  I know how to do this manually, but I would like to automate it with power automate. 
 
I cannot figure out how to do this or if it is even possible. 
 
Any help would be much appreciated. 
Categories:
I have the same question (0)
  • Verified answer
    Michael E. Gernaey Profile Picture
    53,493 Super User 2025 Season 2 on at
     
    So, let's break down what you want
     
    1. Trigger a flow when a file is created or modified
    2. You then want to update that files (in the document library) expiry date, by adding 40 days to today's date
     
    Let's me get you started
     
    1. Add a Trigger When a file is created or modified (properties only)
    2. Add an Update File Properties  
    using an addDays expression to add 40 days
     
    And its literally 2 actions like this
     
     
    Please mark this as the Answer if it answers your question, and maybe a like :-)
    Cheers
     
  • JP-08041315-0 Profile Picture
    14 on at
    Ah cools thanks, I was trying something like that, but couldn't figure out the right action function.
     
    However there is one issue with the addDays function, is that you seem to be using utcNow which is the current days date, however, I wish it to be the day the document was created. 
     
    Having said that I suppose the day the document is created would be "today's date". So I guess that works. 
     
    Thanks again, much appreciated. 
  • JP-08041315-0 Profile Picture
    14 on at
    I have a new problem, I'm getting a fail when the flow executes, because it says the file is locked. 
     
    I presume it has something to do with the fact that when you create it a file, it immediately opens it and perhaps its' properties can't be edited while it's open or something. 
     
    The exact error is the following : Action 'Update_file_properties' failed: Le fichier « https://......Documentation/TestJames/Document.docx Â» est verrouillé pour une utilisation partagée par james.paterson
     
    It's in french cause I work in france but it's saying the file is locked for shared use by myself. 

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

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard