Skip to main content
Community site session details

Community site session details

Session Id : Az+iGuOFSwCgC9vVid2la5
Power Automate - Building Flows
Answered

Adaptive Card Issue - How to use dynamic size choice set from JSON

Like (0) ShareShare
ReportReport
Posted on 15 Feb 2024 01:23:46 by 7

Hi I have an automation that reads in a csv and converts it to JSON for easy manipulation. The csv is full of user subscription data. The goal is to send the users an email asking if they use their subscriptions and I've gotten the automation to work, except that it sends a separate email for each one. Idealy I'd like to create an adaptive card with all the subscriptions for a given user that asks if each one is in use. I've created the adaptive card and gotten it to display correctly on adaptivecards.io but cannot get it to display correctly in the actual automation. What am I doing wrong?

 

Here's the JSON for my card:
{
"type": "AdaptiveCard",
"body": [
{
"type": "Container",
"style": "emphasis",
"items": [
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"items": [
{
"type": "TextBlock",
"size": "Large",
"weight": "Bolder",
"text": "**Which Subscriptions Aren't Needed?**",
"style": "heading",
"wrap": true
}
],
"width": "stretch"
}
]
}
],
"bleed": true
},
{
"type": "Container",
"spacing": "Large",
"style": "emphasis",
"items": [
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"items": [
{
"type": "TextBlock",
"weight": "Bolder",
"text": "SUBSCRIPTION",
"wrap": true
}
],
"width": "stretch"
},
{
"type": "Column",
"spacing": "Large",
"items": [
{
"type": "TextBlock",
"weight": "Bolder",
"text": "DEPARTMENT",
"wrap": true
}
],
"width": "auto"
},
{
"type": "Column",
"spacing": "Large",
"items": [
{
"type": "TextBlock",
"weight": "Bolder",
"text": "Subscription Used?",
"wrap": true
}
],
"width": "auto"
}
]
}
],
"bleed": true,
"$data": "${userSub}"
},
{
"type": "Container",
"items": [
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"items": [
{
"type": "TextBlock",
"text": "${subscription}",
"wrap": true,
"id": "subscription"
}
],
"width": 1
},
{
"type": "Column",
"spacing": "Medium",
"items": [
{
"type": "TextBlock",
"text": "${department}",
"wrap": true
}
],
"width": 1
},
{
"type": "Column",
"spacing": "Medium",
"items": [
{
"type": "Input.ChoiceSet",
"id": "SubscriptionNeededStatus",
"style": "expanded",
"isRequired": true,
"errorMessage": "This is a required input",
"choices": [
{
"title": "Yes",
"value": "True"
},
{
"title": "No",
"value": "False"
}
]
}
],
"width": 1
}
]
}
],
"$data": "${$root.user_subs}"
},
{
"type": "Container"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.4",
"fallbackText": "This card requires Adaptive Cards v1.5 support to be rendered properly."
}

 

 

 

Here's the JSON data that was working on the website:

{
    "user_subs": [
        {
            "email": "bob.bobbert@company.com",
            "last_name": "Bobbert",
            "first_name": "Bob",
            "department": "department 1",
            "subscription": "Subscription A",
            "creation_date": "11-Jun-21",
            "status": "active",
            "part_number": "AAAAAAAA",
            "region": "Global",
            "contract": "Contract1"
        },
        {
            "email": "bob.bobbert@company.com",
            "last_name": "Bobbert",
            "first_name": "Bob",
            "department": "department 1",
            "subscription": "Subscription B",
            "creation_date": "11-Jun-21",
            "status": "active",
            "part_number": "AAAAAAAA",
            "region": "Global",
            "contract": "Contract1"
        },
        {
            "email": "bob.bobbert@company.com",
            "last_name": "Bobbert",
            "first_name": "Bob",
            "department": "department 1",
            "subscription": "Access",
            "creation_date": "",
            "status": "",
            "part_number": "",
            "region": "",
            "contract": ""
        }
    ]
}
  • TyTerror Profile Picture
    7 on 27 Mar 2024 at 14:11:55
    Re: Adaptive Card Issue - How to use dynamic size choice set from JSON

    This actually worked great. I had to change it a bit to use data from a csv instead of a SharePoint list but the functionality is the same.

  • Verified answer
    ManishSolanki Profile Picture
    15,085 Super User 2025 Season 2 on 18 Feb 2024 at 17:31:41
    Re: Adaptive Card Issue - How to use dynamic size choice set from JSON

    Hi @TyTerror 

     

    I have posted the solution on my blog site, pls check it out:

    How to design an Adaptive card to receive multiple responses from team message for SharePoint list items? (manish-solanki.com)

     

    You have to skip get items & update item actions as those are not required in your case.

     

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

  • TyTerror Profile Picture
    7 on 15 Feb 2024 at 01:25:30
    Re: Adaptive Card Issue - How to use dynamic size choice set from JSON

    Here's what the card looks like on the website

    TyTerror_0-1707960264445.png

    Here's what it looks like in the emails from the automation

    TyTerror_1-1707960317371.png

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 2

Loading complete