【发布时间】:2021-12-14 02:46:10
【问题描述】:
我目前正在学习自适应卡,以便在 Power Automate 中使用它来将它们发送给 Microsoft 团队。
作为练习,我需要制作这张卡片:Candidate FeedBack form
我在Microsoft Adaptive card designer 中构建了卡片,并得到了这张卡片的有效载荷:
{
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"size": "Medium",
"weight": "Bolder",
"text": "CANDIDATE FEEDBACK FORM"
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "auto",
"items": [
{
"type": "Image",
"url": "{CandidateUrl}",
"altText": "ProfilePicture",
"horizontalAlignment": "Left",
"style": "Person"
}
],
"horizontalAlignment": "Center",
"verticalContentAlignment": "Center"
},
{
"type": "Column",
"width": "auto",
"horizontalAlignment": "Center",
"verticalContentAlignment": "Center",
"style": "emphasis",
"items": [
{
"type": "TextBlock",
"text": "{Candidate Name}",
"wrap": true,
"color": "Dark"
}
]
}
]
},
{
"type": "Container",
"backgroundImage": {
"url": "https://www.solidbackgrounds.com/images/950x350/950x350-light-gray-solid-color-background.jpg"
},
"items": [
{
"type": "Input.Text",
"placeholder": "Input candidate comments",
"id": "CandidateComments",
"isMultiline": true,
"isRequired": true,
"label": "Comments",
"errorMessage": "You must set the candidate comments"
},
{
"type": "Input.ChoiceSet",
"choices": [
{
"title": "Hire",
"value": "Hire"
},
{
"title": "No Hire",
"value": "No Hire"
}
],
"placeholder": "Placeholder text",
"isRequired": true,
"style": "expanded",
"id": "Decision",
"label": "Decision",
"errorMessage": "You must select the decision"
},
{
"type": "Input.ChoiceSet",
"choices": [
{
"title": "Past experience in the topic area",
"value": "Experience"
},
{
"title": "Inclusive behaviors and work ethics",
"value": "Inclusivity"
},
{
"title": "Ability to work without supervision",
"value": "Independent"
}
],
"placeholder": "Placeholder text",
"isMultiSelect": true,
"style": "expanded",
"label": "Suggest follow-up discussion regarding:",
"id": "Suggestion"
}
]
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.0",
"actions": [
{
"type": "Action.Submit",
"title": "Submit"
}
]
}
该卡工作正常,但我有一个想法,但我无法做到。问题是,我希望仅当用户选择“雇用”决定时才会出现“建议选择”元素,因为与您决定不雇用的人进行后续讨论没有多大意义。
我注意到 ChoiceSet 有一个名为“仅在何时显示”的属性,但我只能使用示例数据编辑器使其工作。例如,当我将此数据添加到示例数据编辑器时:
{
"Test":"Testing"
}
“仅在何时显示”中的这个表达式:${$root.Test == “Testing”},它可以工作,但我不需要它来处理样本数据,但是当 id “Decision” 相等时聘请”。那么问题来了,我如何才能实现仅在 id“Decision”等于“Hire”时才显示 ChoiceSet。
PS:我看到的另一件事是,我可以将 ChoiceSet 取消标记为“初始可见”,并且有一个动作“ToggleVisibility”可以使其可见,但我不知道如何仅在雇用决定已选择。
提前谢谢你!
【问题讨论】:
标签: microsoft-teams power-automate adaptive-cards rpa