Loop through Topic with Adaptive Card

289 Views Asked by At

I am creating a bot for Microsoft Teams using Power Automate and Power Virtual Agent. I am using an adaptive card as an output where I intend for it to provide an answer and clickable source. I am struggling to find a solution to loop through the source as it is from Power Automate in a list. I have compose it and set it as an output for Power Virtual Agent. Here's what I have worked out so far. source has values link and name.

The idea I had was to do a for loop using the formula method of the adaptive card. Here is my code:

{
  type: "AdaptiveCard",
  '$schema': "http://adaptivecards.io/schemas/adaptive-card.json",
  version: "1.0",
  body: [
    {
      type: "TextBlock",
      text: Topic.answer,
      wrap: true
    },
    {
      type: "ActionSet",
      actions: [
        ForAll(ParseJSON(Topic.source).value,{
          type: "Action.OpenUrl",
          title: ThisRecord.Name,
          url: ThisRecord.Link
        })
      ]
    }
  ]
}

However, it is only giving the body as an output without the action.

0

There are 0 best solutions below