I've been trying to work a flow to send out an email for events that occur on a specific day of the month. However I cannot get the logic right, and flow keeps telling me the expression is invalid, and I cannot for the life of me see why.
Basically we have a event on the 1st tuesday of specific months, the idea is when someone submits a form, it replies with an email saying the next dates are the next 4 dates from today - I'm processing them into an array and ordering them in the email so it makes sense. I just can't seem to get the formula quite correct to calculate the date for each month.
I just get expression is invalid
addDays(
startOfMonth(
addToTime(
utcNow(),
if(greater(int(formatDateTime(utcNow(), 'MM')), 8), 12 - int(formatDateTime(utcNow(), 'MM')) + 8, 8 - int(formatDateTime(utcNow(), 'MM'))),
'Month'
)
),
mod(9 - dayOfWeek(
startOfMonth(
addToTime(
utcNow(),
if(greater(int(formatDateTime(utcNow(), 'MM')), 8), 12 - int(formatDateTime(utcNow(), 'MM')) + 8, 8 - int(formatDateTime(utcNow(), 'MM'))),
'Month'
)
)
), 7)
)
Michael E. Gernaey
566
Super User 2025 Season 1
David_MA
516
Super User 2025 Season 1
stampcoin
492