Hi All,
I have a flow scheduled monthly to send an email if an item in a list has a due date within the next 34 days (ie next month). However, when I run the flow, it results true for every item, even those with due dates months from now. Any idea what I am missing?
"isTrigger":false,
"operationName": "Condition", "operationDefinition":
{"type":"If","expression":
{"and":[
{"lessOrEquals":["@formatDateTime(outputs('Compose'),'yyyy-mm-dd')","@addDays(utcNow(),34,'yyyy-mm-dd')"]},
{"or":[{"equals":["@items('Apply_to_each')?['Status/Value']","Pending"]},{"equals":["@items('Apply_to_each')?['Status/Value']","Delayed"]}]}]},
"actions": {"Send_an_email_(V2)": {"type":"OpenApiConnection",
"inputs":{"host":{"connectionName":"shared_office365","operationId":"SendEmailV2","apiId":"/providers/Microsoft.PowerApps/apis/shared_office365"},
"parameters":{"emailMessage/To":"email@address","emailMessage/Subject":"test","emailMessage/Body":"<p>aasdfasdfasdf</p>"},"authentication":"@parameters('$authentication')"},
"runAfter":{}}},
"runAfter":{"Compose":["Succeeded"]}}}
Looks like this works -- thank you! and thank you for the formatting catch!
Hello @AAallday ,
can you add 2 Compose actions just before the condition, put @formatDateTime(outputs('Compose'),'yyyy-mm-dd') into one of them and @addDays(utcNow(),34,'yyyy-mm-dd') into the other? You'll then see in the run history what dates enter the condition and if it should return true/false.
Also, the date format you use ('yyyy-mm-dd') is not right. Lowercase 'mm' = minutes. For months it must be upper case 'MM'. The format should be 'yyyy-MM-dd'.
WarrenBelz
146,765
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,091
Most Valuable Professional