Hello,
I need help in creating adaptive cards which are dynamic. The dynamic values has to be used in Input.choiceset and action.submit.
So, please share two samples one for input.choiceset and another for action.submit.
@HenryJammes, Could you please help me out.
Regards
Yogesh
Hello @HenryJammes,
I am having difficulty in passing the variable into adaptive card. Please check the file which I have attached above for further details.
Thanks
Yogesh
You have to format dynamic data to be the JSON format adaptive cards take. Use Power Automate to make variables that are formatted correctly. Then pass those variables to the adaptative card.
Create flows that post adaptive cards to Microsoft Teams - Power Automate | Microsoft Learn
Hello @HenryJammes ,
Thanks for the reply.
I parsed the data. I am having issues in using the data in adaptive card only.
Please refer the zipped file. Please let me know the solution.
Regards
Yogesh
I have a power automate flow that does this with composing a variable, and posting in. the card is formatted like this:
{
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"size": "large",
"text": "Worktype Set to Must Change: Please update below",
"weight": "Bolder",
"wrap": true
},
{
"type": "TextBlock",
"size": "Medium",
"weight": "Bolder",
"text": "@{items('Apply_to_each')?['ticket']?['id']}- @{items('Apply_to_each')?['ticket']?['summary']}",
"maxLines": 0,
"wrap": true
},
{
"type": "TextBlock",
"text": "@{items('Apply_to_each')?['notes']}",
"wrap": true
},
{
"type": "Input.ChoiceSet",
"placeholder": "New Work Type",
"choices": [
@{variables('worktypes')}
{
"title": "Do not use",
"value": "2"
}
],
"id": "typeWord"
}
],
"actions": [
{
"type": "Action.Submit",
"title": "Submit",
"id": "submit"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.4"
}
The variable @{variables('worktypes')} is grabbed and formatted to a string in a previous step:
I'm not sure if this is what you mean exactly, and it may not be formatted perfectly for what you need in PVA. Maybe it's a start though!