SOLVED

Auto Dates Update in SharePoint List

Copper Contributor

Hi, there.

 

I have a list of clients in an accounting firm that all have fixed dates for various reasons.  Once the client is entered into the list with their corresponding dates for this year (2019) I want to avoid having to go back into the list again and update the year for 2020.  Is there a way I can update these dates automatically at the start of each new year?

 

Thanks and look forward to any guidance you may have.

 

 

7 Replies

@Workplaces,

 

Would you mind to elaborate a little on the SharePoint list and give an example of the metadata?  Is this year like a Year date column?  If I understand you correctly, you are wanting to update all existing list items with a new year?  For example, there is a column called "renewal date" that are all 2019, and you want this to automatically roll over to 2020?  There are a few ways you could handle this depending on the configuration:

 

  1. Use an additional column that is of type calculated.  If you had a column like "StartingDate", then create a new calculated column called "ExpirationDate" with a formula to either add 365 days from that date, or concatenate the current year plus month and day from the "StartingDate".
  2. Use Excel and Quick Edit you can use Excel to update via formula then copy/paste back into the SharePoint list.
  3. Write a Microsoft Flow with a trigger of once yearly on Jan 1 of that year to get all items in the list, for each item get the "ExpirationDate" and update the date to the current year.

If you give me a little more details of the list I can make a more pointed recommendation.

@Doug Allen 

 

Thanks for the follow-up Doug!

 

The dates I have are dates associated with when a client's payroll is due, or when taxes need to be done etc.  So each year, the date in terms of month and day remain the same but of course, the year needs to change for each new year.  To you question (@If I understand you correctly, you are wanting to update all existing list items with a new year? For example, there is a column called "renewal date" that are all 2019, and you want this to automatically roll over to 2020?), yes, 100% correct.

 

I've attached a screenshot for you if that helps.

 

 

@Workplaces,

 

Great thanks for confirming.  The best option here would be a Microsoft Flow.  I did a quick test and in simplest terms it takes a trigger and 2 actions:

 

  1. Trigger - Run once yearly on Jan 1
  2. Get the items in the list
  3. For each item in the list, update the column for the item

I'm using an expression for the value but you could use OOTB actions for this.  Here is my Flow:

Flow to set days.png

 

The Start Date in my example is the column to update.  I use the following expression:

 

addDays(items('Apply_to_each')?['StartDate'],365)
 
You would need to update the column names (use the internal name of the column).  Let me know if you have any questions.  If this trigger runs in early morning, you might have to take time zone into account.  
Doug

That worked perfectly!  Thanks, Doug!

best response confirmed by Workplaces (Copper Contributor)
Solution

@Workplaces,

 

I'm glad to hear it.  If you feel this was the solution, I'd greatly appreciate marking my answer as the solution.  Thanks!

Done! Sorry...brand new to the forum. Thanks again!

@Workplaces, no problem always glad to help.  If you need any help on Flow in the future be sure to check out the dedicated Flow community

1 best response

Accepted Solutions
best response confirmed by Workplaces (Copper Contributor)
Solution

@Workplaces,

 

I'm glad to hear it.  If you feel this was the solution, I'd greatly appreciate marking my answer as the solution.  Thanks!

View solution in original post