Hi all,
I am going round in circles...
I need to create an adaptive card that waits for a response BUT I need need to be able to create the card dynamically - not just pipe in variables to a static card. I have indeed searched and found similar queries but no real solution I can see.
Is there a way to either:
The adaptive card I am building is a class roll. The number of students obviously changes in each class. To create my card I have Parsed a List Rows action to JSON then looped through each value to create the 'student row' in the Adaptive Card. The header section has some specific info about the class - tutor, date etc. The footer also includes a common textbox and submit action.
Doing it this way means I don't have to create a generic card that allows for 50 or so students and then hide each ColumnSet that I have no student for. EG: 20 students would mean the adaptive card would have 30 'hidden' rows. Each adaptive card is net and tidy. It work too.
Anyone got any thoughts or direction?
{
"type": "AdaptiveCard",
"body": [
{
"type": "Container",
"items": [
{
"type": "TextBlock",
"text": "Class Roll",
"wrap": true,
"weight": "Bolder",
"size": "ExtraLarge"
},
{
"type": "TextBlock",
"size": "Large",
"weight": "Bolder",
"text": "Dunedin Year One July 2020 Thurs Michael 27",
"spacing": "Small"
},
{
"type": "TextBlock",
"weight": "Bolder",
"text": "Allocated Tutor: Michael",
"wrap": true,
"size": "Medium",
"spacing": "None"
},
{
"type": "TextBlock",
"spacing": "None",
"text": "Class Date: Friday, March 19, 2021 8:00 AM",
"wrap": true,
"size": "Medium"
},
{
"type": "TextBlock",
"text": "Role due by: Friday, March 19, 2021 8:00 PM",
"wrap": true,
"size": "Medium",
"spacing": "None"
},
{
"type": "Input.Text",
"placeholder": "TotalRegistrants",
"id": "TotalRegistrants",
"isVisible": false,
"value": "8"
},
{
"type": "Input.Text",
"placeholder": "EventGUID",
"isVisible": false,
"value": "732fb3d4-00b9-ea11-a812-000d3ad0231d",
"id": "EventGUID"
}
]
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": 40,
"items": [
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": 10,
"items": [
{
"type": "TextBlock",
"text": "Num",
"wrap": true,
"size": "Medium",
"weight": "Bolder"
}
]
},
{
"type": "Column",
"width": 50,
"items": [
{
"type": "TextBlock",
"text": "Trainee",
"wrap": true,
"weight": "Bolder",
"size": "Medium"
}
]
},
{
"type": "Column",
"width": 40,
"items": [
{
"type": "TextBlock",
"text": "Attendance",
"wrap": true,
"weight": "Bolder",
"size": "Medium"
}
]
}
],
"spacing": "Large",
"separator": true
}
]
}
]
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": 10,
"items": [
{
"type": "TextBlock",
"text": "1"
}
]
},
{
"type": "Column",
"width": 50,
"style": "default",
"items": [
{
"type": "TextBlock",
"text": "Aiden Mallon"
}
]
},
{
"type": "Column",
"width": 40,
"items": [
{
"type": "Input.Text",
"isVisible": false,
"id": "R1GUID",
"value": "1767b6fc-00b9-ea11-a812-000d3ad00c01"
},
{
"type": "Input.ChoiceSet",
"choices": [
{
"title": "Yes",
"value": "Yes"
},
{
"title": "No",
"value": "No"
}
],
"placeholder": "Attendance",
"value": "No",
"id": "R1A",
"style": "compact"
}
]
}
],
"spacing": "None",
"separator": true
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": 10,
"items": [
{
"type": "TextBlock",
"text": "2"
}
]
},
{
"type": "Column",
"width": 50,
"style": "default",
"items": [
{
"type": "TextBlock",
"text": "Cody McCarthy"
}
]
},
{
"type": "Column",
"width": 40,
"items": [
{
"type": "Input.Text",
"isVisible": false,
"id": "R2GUID",
"value": "44686730-9a19-eb11-a813-000d3ad00c01"
},
{
"type": "Input.ChoiceSet",
"choices": [
{
"title": "Yes",
"value": "Yes"
},
{
"title": "No",
"value": "No"
}
],
"placeholder": "Attendance",
"value": "No",
"id": "R2A",
"style": "compact"
}
]
}
],
"spacing": "None",
"separator": true
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": 10,
"items": [
{
"type": "TextBlock",
"text": "3"
}
]
},
{
"type": "Column",
"width": 50,
"style": "default",
"items": [
{
"type": "TextBlock",
"text": "Jared Hayes"
}
]
},
{
"type": "Column",
"width": 40,
"items": [
{
"type": "Input.Text",
"isVisible": false,
"id": "R3GUID",
"value": "6e3b24b9-37c2-ea11-a812-000d3ad07de6"
},
{
"type": "Input.ChoiceSet",
"choices": [
{
"title": "Yes",
"value": "Yes"
},
{
"title": "No",
"value": "No"
}
],
"placeholder": "Attendance",
"value": "No",
"id": "R3A",
"style": "compact"
}
]
}
],
"spacing": "None",
"separator": true
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": 10,
"items": [
{
"type": "TextBlock",
"text": "4"
}
]
},
{
"type": "Column",
"width": 50,
"style": "default",
"items": [
{
"type": "TextBlock",
"text": "Jonas Barakauskas"
}
]
},
{
"type": "Column",
"width": 40,
"items": [
{
"type": "Input.Text",
"isVisible": false,
"id": "R4GUID",
"value": "1df1be5c-09d6-ea11-a813-000d3ad0231d"
},
{
"type": "Input.ChoiceSet",
"choices": [
{
"title": "Yes",
"value": "Yes"
},
{
"title": "No",
"value": "No"
}
],
"placeholder": "Attendance",
"value": "No",
"id": "R4A",
"style": "compact"
}
]
}
],
"spacing": "None",
"separator": true
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": 10,
"items": [
{
"type": "TextBlock",
"text": "5"
}
]
},
{
"type": "Column",
"width": 50,
"style": "default",
"items": [
{
"type": "TextBlock",
"text": "Kyle Cuthbertson"
}
]
},
{
"type": "Column",
"width": 40,
"items": [
{
"type": "Input.Text",
"isVisible": false,
"id": "R5GUID",
"value": "1cbc9d59-98c4-ea11-a812-000d3ad07de6"
},
{
"type": "Input.ChoiceSet",
"choices": [
{
"title": "Yes",
"value": "Yes"
},
{
"title": "No",
"value": "No"
}
],
"placeholder": "Attendance",
"value": "No",
"id": "R5A",
"style": "compact"
}
]
}
],
"spacing": "None",
"separator": true
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": 10,
"items": [
{
"type": "TextBlock",
"text": "6"
}
]
},
{
"type": "Column",
"width": 50,
"style": "default",
"items": [
{
"type": "TextBlock",
"text": "Liam Ferner"
}
]
},
{
"type": "Column",
"width": 40,
"items": [
{
"type": "Input.Text",
"isVisible": false,
"id": "R6GUID",
"value": "4f638705-98c4-ea11-a812-000d3ad07de6"
},
{
"type": "Input.ChoiceSet",
"choices": [
{
"title": "Yes",
"value": "Yes"
},
{
"title": "No",
"value": "No"
}
],
"placeholder": "Attendance",
"value": "No",
"id": "R6A",
"style": "compact"
}
]
}
],
"spacing": "None",
"separator": true
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": 10,
"items": [
{
"type": "TextBlock",
"text": "7"
}
]
},
{
"type": "Column",
"width": 50,
"style": "default",
"items": [
{
"type": "TextBlock",
"text": "Mark Kennard"
}
]
},
{
"type": "Column",
"width": 40,
"items": [
{
"type": "Input.Text",
"isVisible": false,
"id": "R7GUID",
"value": "cd700ec3-aab9-ea11-a812-000d3ad00c01"
},
{
"type": "Input.ChoiceSet",
"choices": [
{
"title": "Yes",
"value": "Yes"
},
{
"title": "No",
"value": "No"
}
],
"placeholder": "Attendance",
"value": "No",
"id": "R7A",
"style": "compact"
}
]
}
],
"spacing": "None",
"separator": true
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": 10,
"items": [
{
"type": "TextBlock",
"text": "8"
}
]
},
{
"type": "Column",
"width": 50,
"style": "default",
"items": [
{
"type": "TextBlock",
"text": "Samuel Russell"
}
]
},
{
"type": "Column",
"width": 40,
"items": [
{
"type": "Input.Text",
"isVisible": false,
"id": "R8GUID",
"value": "2b0829d0-97c4-ea11-a812-000d3ad0231d"
},
{
"type": "Input.ChoiceSet",
"choices": [
{
"title": "Yes",
"value": "Yes"
},
{
"title": "No",
"value": "No"
}
],
"placeholder": "Attendance",
"value": "No",
"id": "R8A",
"style": "compact"
}
]
}
],
"spacing": "None",
"separator": true
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": 50,
"items": [
{
"type": "Input.Text",
"placeholder": "Tutor comments",
"maxLength": 2000,
"id": "TutorComment",
"isMultiline": true
}
]
}
],
"separator": true
},
{
"type": "ActionSet",
"actions": [
{
"type": "Action.Submit",
"title": "Submit Roll",
"iconUrl": "HTTP HERE"
}
],
"horizontalAlignment": "Right"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.2"
}
Solved! Go to Solution.
Found a solution:
I Exported the solution then edited the JSON file for the flow. Where the body of the Adaptive Card was, I replaced it with the variable I had the flow build.
I followed this post's solution to get to the Workflow - then I just opened it in Notepad++, and changed the Adaptive Card Body with my Variable and done
Solved: Re: Copy/Duplicate a Flow in a Solution - Power Platform Community (microsoft.com)
This has worked 100%
Woot!
Hi @RussellR,
I am glad your issue has been solved by yourself
You could go ahead and mark the post as solved by clicking “Accept as Solution” so that this thread will be marked for other users to easily identify!
Best Regards,
Community Support Team _ Lin Tu
Found a solution:
I Exported the solution then edited the JSON file for the flow. Where the body of the Adaptive Card was, I replaced it with the variable I had the flow build.
I followed this post's solution to get to the Workflow - then I just opened it in Notepad++, and changed the Adaptive Card Body with my Variable and done
Solved: Re: Copy/Duplicate a Flow in a Solution - Power Platform Community (microsoft.com)
This has worked 100%
Woot!
Hi @RussellR,
I am glad your issue has been solved by yourself
You could go ahead and mark the post as solved by clicking “Accept as Solution” so that this thread will be marked for other users to easily identify!
Best Regards,
Community Support Team _ Lin Tu
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
Did you know that you could restore a deleted flow? Check out this helpful article.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
26 | |
25 | |
24 | |
23 | |
23 |
User | Count |
---|---|
61 | |
50 | |
44 | |
31 | |
27 |