I have a list on SharePoint that records various items of equipment and when their maintenance expiry dates are. I want to be able to, on a weekly basis, pull the list into a Power Automate flow, filter out all the rows (i.e. items of equipment) which do not have a maintenance expiry date and then filter again the rows that are left whose expiry date is less than 42 days (6 weeks) away. I would then send an email to the relevant person about whichever items remain. The column variables are:
-
"Maintenance Date" = the last date that maintenance was performed; this column is of the Date and Time format.
-
"Maintenance Period" = the length of time before the next maintenance is required in months (e.g. "12" = 12 months); this is a "Single line of text" column.
I can filter out the rows which do not have a maintenance period:
Maintenance_x0020_Period ne ''
My issue is trying to filter out rows by columns of the Date and Time format, as the flow is returning an error saying that the date formats aren't a match, but trying to use formatDateTime doesn't seem to work. The kind of thing I want to have is this:
Maintenance_x0020_Period ne '' and (@{'addToTime(Maintenance_x0020_Date, Maintenance_x0020_Period, 'month')'} le @{'addDays(utcNow(),42)'})
This way, the blanks are removed and only the items within 42 days of their maintenance expiry date would be left.
TIA

Report
All responses (
Answers (