@lessOrEquals(ticks(outputs('Compose_End_Date')), addMonths(ticks(outputs('Compose_Start_Date')), 10))
这个表达式将检查两个日期之间的差距是否在10个月以内。如果符合条件,Filter操作将返回True。
以下是一个完整的适用于此场景的Logic App代码示例:
{
"actions": {
"Set_Start_Date": {
"inputs": "@{utcNow()}",
"runAfter": {},
"type": "Compose"
},
"Set_End_Date": {
"inputs": "@{addDays(utcNow(), 365)}",
"runAfter": {
"Set_Start_Date": [
"Succeeded"
]
},
"type": "Compose"
},
"Filter_Dates": {
"actions": {},
"condition": "@lessOrEquals(ticks(outputs('Set_End_Date')), addMonths(ticks(outputs('Set_Start_Date')), 10))",
"runAfter": {
"Set_End_Date": [
"Succeeded"
]
},
"type": "If"
}
},
"start": {
"runAfter": {},
"type": "InitializeVariable"
},
"triggers": {
"Recurrence": {
"recurrence": {
"frequency": "Minute",
"interval": 15
},
"type": "Recurrence"
}
}
}
上一篇:AzureLogicApp中的条件未能评估为True或False。
下一篇:AzureLogicApp:使用ServiceBus触发器时出现错误,message:从令牌交换中出现的错误.....