web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / Display dynamic content.
Copilot Studio
Answered

Display dynamic content.

(1) ShareShare
ReportReport
Posted on by 10
Hello,
 
In an airlines Usecase, I am getting the passenger details like name and age using an adaptive card. When I am having multiple passengers, I have to update them in DB using API. How to save the variable of the passengers. And how to use it. 
[
{
    "Name": "Jane Doe",
    "passenger_type": "Adult",
    "flight_id": 1,
    "seat_number": "1A",
    "age": 28,
    "ticket_number": "1-1-112323"
},
{
    "Name": "John Doe",
    "passenger_type": "Adult",
    "flight_id": 1,
    "seat_number": "2B",
    "age": 28,
    "ticket_number": "1-1-112323"
}
]
This is the API schema. For name and age, I am using dynamic adaptive card to get user input. So, How I should save the variable or suggest me someother solution.
 
 
Usecase: Ask how many passengers to travel. And fetch all the passengers info and send it to DB. 
Categories:
I have the same question (0)
  • fchopo Profile Picture
    8,003 Moderator on at
    Hi,
    I would use an "Ask with adaptive card" action with the following code:
    {
        "type": "AdaptiveCard",
        "body": [
            {
                "type": "TextBlock",
                "text": "Passenger 1",
                "weight": "bolder",
                "size": "medium"
            },
            {
                "type": "Input.Text",
                "id": "Name1",
                "placeholder": "Enter name"
            },
            {
                "type": "Input.ChoiceSet",
                "id": "passenger_type1",
                "style": "compact",
                "choices": [
                    {
                        "title": "Adult",
                        "value": "Adult"
                    },
                    {
                        "title": "Child",
                        "value": "Child"
                    }
                ]
            },
            {
                "type": "Input.Number",
                "id": "flight_id1",
                "placeholder": "Enter flight ID"
            },
            {
                "type": "Input.Text",
                "id": "seat_number1",
                "placeholder": "Enter seat number"
            },
            {
                "type": "Input.Number",
                "id": "age1",
                "placeholder": "Enter age"
            },
            {
                "type": "Input.Text",
                "id": "ticket_number1",
                "placeholder": "Enter ticket number"
            },
            {
                "type": "TextBlock",
                "text": "Passenger 2",
                "weight": "bolder",
                "size": "medium"
            },
            {
                "type": "Input.Text",
                "id": "Name2",
                "placeholder": "Enter name"
            },
            {
                "type": "Input.ChoiceSet",
                "id": "passenger_type2",
                "style": "compact",
                "choices": [
                    {
                        "title": "Adult",
                        "value": "Adult"
                    },
                    {
                        "title": "Child",
                        "value": "Child"
                    }
                ]
            },
            {
                "type": "Input.Number",
                "id": "flight_id2",
                "placeholder": "Enter flight ID"
            },
            {
                "type": "Input.Text",
                "id": "seat_number2",
                "placeholder": "Enter seat number"
            },
            {
                "type": "Input.Number",
                "id": "age2",
                "placeholder": "Enter age"
            },
            {
                "type": "Input.Text",
                "id": "ticket_number2",
                "placeholder": "Enter ticket number"
            }
        ],
        "actions": [
            {
                "type": "Action.Submit",
                "title": "Submit"
            }
        ],
        "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
        "version": "1.3"
    }
    Then, you can read all the values and call a Power Automate flow, for instance, that would create multiple records into a database:
     
     
    Hope it helps!
    Ferran
  • Verified answer
    Vinoth Selvam Profile Picture
    1,592 Super User 2025 Season 1 on at
     
    I will try the below steps.
     
    1. Use an initial Adaptive Card to ask the user how many passengers will be traveling. Save the response (NoOfPass) in a variable.
    2. Once you have the number of passengers (NoOfPass), generate a new Adaptive Card for each passenger to collect details like name, age, and any other required fields. Use a loop in your backend or bot logic to generate these cards dynamically.
    3. As each Adaptive Card is submitted, store the passenger details in a collection (e.g., a JSON array or a list) in your bot.
    4. Once all responses are collected, send the array to the API. You can use a Power Automate to do it.
     
     
    Thanks.
    For Copilot studio technical blogs: Visit my Site
     
  • CU09121232-0 Profile Picture
    10 on at
     
    Could you please explain your 2nd point. How to make them dynamic.
     
    Hello@fchopo,
     
    Could you please tell me how to make that adaptive card dynamic. That would be very helpful.
     
    Thanks in advance to both.
     
    Regards
    Yogesh

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Copilot Studio

#1
Valantis Profile Picture

Valantis 618

#2
Haque Profile Picture

Haque 147

#3
Vish WR Profile Picture

Vish WR 140

Last 30 days Overall leaderboard