Forum Discussion
Send email notification when calculated field value changes
- Jan 25, 2023
Hi SZLK85
a calculated column in SharePoint does only update if you update the item itself. If you want to dynamically display the remaining days then use this formatting sheet on your date column{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "txtContent": "=floor((Number(@currentField)-Number(Date((getMonth(@now)+1)+'.'+getDate(@now)+'.'+getYear(@now))))/(60*60*24*1000))+' day(s) remaining'" }
You can create a new scheduled flow that runs every day at a certain time.
Then calculate in a variable "30DaysIntheFuture" the date 30 days in the futureconvertToUtc(startOfDay(addDays(convertTimeZone(utcNow(),'UTC','W. Europe Standard Time'),30)),'W. Europe Standard Time')
Now use a "Get items" from SharePoint action for your list and set the "Filter Query" toYourDateField eq datetime'@{variables('30DaysIntheFuture')}'
As a result you have all the items where the value of your date column is 30 days in the future.
Now send a Mail for each result.This works if you just have a "Date" field. If you did include the time in your column, then we need to create two variables (One 30 in the future and one 31 days in the future) and check if the column value ist between these two dates.
Best Regards,
Sven
Hi SZLK85 ,
the Odata operator for "greater than" is "gt", not "<", so you should use the filter
UIS_STATUSZ_HIDDEN gt 1
Then I would use the "Create HTML Table" action
The Output will look like this
Best Regards,
Sven