Hi Community,
Problem:
I use this flow to update all records in a SharePoint List with Today's Date so that a calculated field can display "Days Elapsed" from creation of the record to today's date. This gives me automatic ageing for the records without having to modify a record to force a calculated update.
However it negates the built-in alert functionality because all users with alerts would now receive hundreds of email alerts daily when the Today's Date column is updated.
Desired solution:
Prevent Flow from triggering built-in SharePoint alerts.
Work-arounds attempted
Thanks for all the great solutions on this forum that have saved time and energy along the way.
Solved! Go to Solution.
Another idea: use JSON formatting for the 'Days Elapsed' column:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "div",
"txtContent": "=floor((Number(@now)-Number([$Created]))/(1000*60*60*24))"
}
Hello @MikeStuart ,
I think updating all items in a SharePoint list daily is not a good solution, especially if you want to update just a column with today's date.
If it's only about calculation of days since an item was created, you don't need a special column with today's date, you can use today() function in the calculated column to get it. The formula below will calculate number of days since the item was created (today's date - created date) and round it to a number without decimal places.
=ROUNDDOWN((TODAY()-Created),0)
I just read a bit about today() and it doesn't seem to be ideal solution.
Another idea: use JSON formatting for the 'Days Elapsed' column:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "div",
"txtContent": "=floor((Number(@now)-Number([$Created]))/(1000*60*60*24))"
}
Hi @tom_riha ,
Thanks for the proposed solution which seems workable but I have two questions:
The documentation suggests you can use display values for formatting calculations here: https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/column-formatting#displayv... but I tried nesting your code within a standard severity conditional format and just got a blank display. If it is possible to do this can you share sample code for your solution above plus a simple conditional color format (e.g. if display value is greater than 1 then color = red).
Thanks for your reply.
Mike
Hello @MikeStuart ,
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "div",
"txtContent": "=floor((Number(@now)-Number([$Created]))/(1000*60*60*24))",
"style": {
"color": "=if(floor((Number(@now)-Number([$Created]))/(1000*60*60*24)) > 1, '#ff0000', '')"
}
}
@tom_rihaworks perfectly!
For others this might also help:
I ported the conditional formatting I had previously setup on the hard data column to the new JSON formatted display value column and did a "find and replace" of the original JSON column formatting to replace the column name it was referencing:
"[$DAYS_x0020_ELAPSED]"
with the display value calculation (in my case):
"=floor((Number(@now)-Number([$Sent_x0020_to_x0020_FASO_x0020__]))/(1000*60*60*24))"
This resulted in a display value with all my original conditional formatting applied to the new JSON formatted display value.😎
Check out new user group experience and if you are a leader please create your group
See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.
User | Count |
---|---|
51 | |
42 | |
40 | |
39 | |
38 |
User | Count |
---|---|
78 | |
77 | |
71 | |
52 | |
49 |