简体   繁体   English

Azure 逻辑应用 if 语句

[英]Azure logic apps if statement

I'm building an app which basically checks if ad user was fired by HR if it was it sends teams message with 3 options.我正在构建一个应用程序,它基本上检查广告用户是否被 HR 解雇,如果它发送带有 3 个选项的团队消息。 The options are delete user , disable user and do nothing with the user.选项是删除用户、禁用用户和对用户不做任何事情。 After administrator clicks on appropriate option the teams sends another message with confirmation that it was done and what option was used for that action.管理员单击适当的选项后,团队会发送另一条消息,确认已完成以及用于该操作的选项。

So the problem is I can only make an if statement to return only 2 of 3 options.所以问题是我只能做一个 if 语句来只返回 3 个选项中的 2 个。 Is there away to make it check all 3 options and return only one which was used ?有没有让它检查所有 3 个选项并只返回一个使用过的选项?

The submitActionId is always correct when I click on the options当我点击选项时, submitActionId 总是正确的

Here is my if statement if(equals(body('KDVPRequestUserDelete')['submitActionId'], 'Confirm'),'Delete','Disabled')这是我的 if 语句if(equals(body('KDVPRequestUserDelete')['submitActionId'], 'Confirm'),'Delete','Disabled')

My teams action button looks like this:我的团队操作按钮如下所示:

"actions": [
    {
        "horizontalAlignment": "Left",
        "type": "Action.Submit",
        "title": "Ištrinti",
        "style": "positive",
        "id": "Confirm",
        "data": 1,
        "iconUrl": "https://cdn2.iconfinder.com/data/icons/flat-style-svg-icons-part-1/512/cancel_delete_remove_stop-512.png"
    },
    {
        "horizontalAlignment": "Right",
        "type": "Action.Submit",
        "title": "Išjungti",
        "style": "positive",
        "id": "Change",
        "data": 2,
        "iconUrl": "https://cdn3.iconfinder.com/data/icons/leto-arrows-1/64/_cancel_disable-256.png"
    },
    {
        "type": "Action.Submit",
        "title": "Nedaryti nieko",
        "id": "Nothing",
        "data": 3,
        "iconUrl": "https://cdn3.iconfinder.com/data/icons/social-messaging-ui-color-line/254000/172-512.png"
    }
]

} }

You only need to nest an if statement in the if statement, for example:你只需要在if语句中嵌套一个 if 语句,例如:

if(equals(2, 1), 'yes', if(equals(1, 1), 'yes', 'no'))

If 2 is equal to 1, return yes, if it is not true, continue to compare 1 equal to 1, if it is true, return yes, if it is not true, return no.如果2等于1,则返回yes,如果不为真,继续比较1是否等于1,如果为真,则返回yes,如果不为真,则返回no。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM