Hi, everyone!
In my SharePoint document library where they upload contracts, I created additional columns for them to input other contract details such as Start Date, Expiry Date, etc. I wanted to put an Aging column, so that is computed as Date Today less Expiry Date.
I added a "Date Today" column and what I understood from reading other articles is that a flow is needed to update this column daily. So I made this flow like below.
However, when I scroll through my library, not all of the rows for the "Date Today" column were updated. Anybody who has an idea why this is? And what modifications I should do with the flow?
I had to do something similar a while back. I needed to calculate the age based on the date of birth column:
The way this was achieved was using JSON formatting applied the AGE field which allows the age to auto update:
This was the JSON code I used (based on Create an 'Age/Days old' column in SharePoint List😞
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"txtContent": "=substring(toString(Number(@now-@currentField)/86400000/365),0,indexOf(toString(Number(@now-@currentField)/86400000/365),'.')+2)"
}
To learn more see Use view formatting to customize SharePoint
Hope this helps.
Ellis
Hi @ekarim2020
Thanks for the reply!
Let me know if I understood it right. I will create a new column of Date/Time and then input JSON formatting in it like below?
If so, how do I reference the "Expiry Date" column in the column to compute the aging? Basically, I would like to compute =TODAY less "Expiry Date". Sorry, I'm not experienced with JSON.
My experience with JSON formatting is very limited, but I was able to implement the Age field based on the two articles I have linked to in my previous post.
If you are able to get a calculate age formula to working as the first step, then it should be a matter of modifying that working code to give you the Aging data.
Ellis
Hi @ekarim2020 ! After reading the links multiple times, I got it now! I applied it in a Date column and format it to show as a number aging. However, I tried downloading the list as Excel and the column would show as date instead o of a number. I guess that's the trade-off. Anyway, thanks for this tip!
Too bad I didn't get a response on why the simple updating of 'Date Today' column wasn't being applied to all rows.
User | Count |
---|---|
88 | |
37 | |
26 | |
13 | |
13 |
User | Count |
---|---|
127 | |
54 | |
38 | |
24 | |
21 |