Skip to main content

Notifications

Topic Creation & Management
Unanswered

Dynamic adaptive cards

Posted on by 24

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

  • Yogesh3097 Profile Picture
    Yogesh3097 24 on at
    Re: Dynamic adaptive cards

    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

  • JGT Profile Picture
    JGT 32 on at
    Re: Dynamic adaptive cards

    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

  • Yogesh3097 Profile Picture
    Yogesh3097 24 on at
    Re: Dynamic adaptive cards

    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

  • HenryJammes Profile Picture
    HenryJammes on at
    Re: Dynamic adaptive cards

    Hi @Yogesh3097 

     

    Have a look at these:

     

    henry

  • JGT Profile Picture
    JGT 32 on at
    Re: Dynamic adaptive cards

    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:

    JGT_0-1690198114364.png

    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!

     

Helpful resources

Quick Links

Welcome to the Power Platform…

We are thrilled to unveil the newly-launched Power Platform Communities!…

Getting Started…

Welcome to the Power Platform Community! We appreciate your visit…

Welcome to the new Power Platform Community!…

We are excited to announce our new Copilot Cookbook Gallery in the Community…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 138,006

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,059

Leaderboard

Featured topics