How to get a TextBlock Text via Action.Http?

755 views Asked by At

I am trying to get TextBlock Text/Value ("Click Learn More to learn more about Actionable Messages!) in response when clicking Send Feedback. I tried {{Heading.text}} and {{Heading.value}} with Heading being id of a field.

Adaptive Card

Getting value from Input.Text via {{feedbackText.value}} works just fine.

Sample:

{
"type": "AdaptiveCard",
"version": "1.0",
"hideOriginalBody": true,
"body": [
    {
        "type": "TextBlock",
        "text": "Visit the Outlook Dev Portal",
        "size": "Large"
    },
    {
        "type": "TextBlock",
        "text": "Click **Learn More** to learn more about Actionable Messages!",
        "id": "Heading"
    },
    {
        "type": "Input.Text",
        "id": "feedbackText",
        "placeholder": "Let us know what you think about Actionable Messages"
    }
],
"actions": [
    {
        "type": "Action.Http",
        "title": "Send Feedback",
        "method": "POST",
        "url": "https://webhook.site/.....",
        "body": "{{feedbackText.value}}\n{{Heading.text}}\n{{Heading.value}}"
    },
    {
        "type": "Action.OpenUrl",
        "title": "Learn More",
        "url": "https://learn.microsoft.com/outlook/actionable-messages"
    }
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json"}

Thanks for help.

1

There are 1 answers

0
user16799753 On

I had the same issue trying to send the value of the textblock in http body. I used the following workaround:

  1. Created an Input.Number field
  2. Set the Initially Visible property to false
  3. When the Adaptive Card is compose, I used logic app/flow to populate the value of the field
  4. The Action.Http was then set to the id.value value of the input box.