Problem statement
I had a requirement to show the following data returned from the JSON output in the Bot Framework Composer.
[
{
"name": "XYZ Clinic",
"address": "6546 Some Steet",
"city": "SomeCity",
"state": "SomeState",
"zip": "99999",
"phone": "999-888-7777 ",
"ApptTypeName": "PRIMARY CARE",
"newWaitTime": 23.0
},
…
]
Solution
In the send response action here are the Adaptive card related response texts for the above array object. You would call the ResultActivity(objArrayResult).
#ResultThumbnailCard(resultObj)
[ThumbnailCard
title = ${resultObj.name}
subtitle = ${resultObj.ApptTypeName} ${resultObj.newWaitTime} days
text = ${resultObj.address}, ${resultObj.city}, ${resultObj.state} - ${resultObj.zip}
image = https://picsum.photos/200/200
buttons = tel://${resultObj.phone}
]
#ResultActivity(resultArrObj)
[Activity
name = An Example Name
Attachments = ${ foreach ( resultArrObj, x, ResultThumbnailCard(x) ) }
AttachmentLayout = carousel
]
Hey Pankaj,
Everything worked perfectly when I hardcoded the json by just setting a property for the array but I do you get it from the PVA to the composer? I am trying to use the search_for_users_(v2) flow to make a global address book with your help ;). I am having issues passing the json from the flow back to the pva and then to the composer.
Let me know!