0

I built a workflow with Power Automate and Microsoft Lists, delivering emails to users to update records in the Lists.

I got the majority of my workflow worked out, and I'm working through minor bugs right now. One of my flows is triggered when a user clicks a link for a specific item in a list, and they get an actionable message emailed to them with an actionable message update form for that item, with the form values prepopulated with the existing values for that list.

here is what it looks like in my email (prepopulated with existing values for the record):

enter image description here

How it looks when I choose something in the AT&T FOB drop down:

enter image description here

And in Designer - Adaptive Cards

enter image description here

Issues I am having:

Save button isn't colored blue

Cancel Class button isn't colored red

AT&T FOB option isn't defaulted to the existing value in the Lists - figured this one out, Power Automate was passing "True" and "False" and adaptive cards was expecting "true" or "false"

Cancel Class button should remain active even without required values filled in

I have to set version = 1.0 (If I set to 1.4, the action.http buttons do not show)

Additionally, is there a way to display a message if the user opens the email in something other than outlook like "This message must be viewed in Outlook"?

Code:

{
  "type": "AdaptiveCard",
  "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
  "version": "1.0",
  "originator": "redacted",
  "body": [
    {
      "type": "Container",
      "items": [
        {
          "type": "TextBlock",
          "text": "As requested, here is your update form",
          "wrap": true
        },
        {
          "type": "TextBlock",
          "text": "District: @{variables('District')}",
          "wrap": true
        },
        {
          "type": "TextBlock",
          "text": "Date: @{variables('Start Date')}",
          "wrap": true
        },
        {
          "type": "TextBlock",
          "text": "Class Size*",
          "wrap": true
        },
        {
          "type": "Input.Number",
          "placeholder": "1",
          "id": "size",
          "value": @{variables('Class Size')} //replace with 1 in designer
        },
        {
          "type": "TextBlock",
          "text": "Start Time*",
          "wrap": true
        },
        {
          "type": "Input.Text",
          "placeholder": "Start Time",
          "id": "starttime",
          "isRequired": true,
          "label": "Start Time",
          "errorMessage": "Required",
          "value": "@{variables('Start Time')}"
        },
        {
          "type": "TextBlock",
          "text": "Class Location*",
          "wrap": true
        },
        {
          "type": "Input.Text",
          "placeholder": "Class Location",
          "id": "location",
          "isRequired": true,
          "label": "Class Location",
          "errorMessage": "Required",
          "value": "@{variables('Class Location')}"
        },
        {
          "type": "TextBlock",
          "text": "AT&T FOB*",
          "wrap": true
        },
        {
          "type": "Input.ChoiceSet",
          "choices": [
            {
              "title": "Yes",
              "value": "true"
            },
            {
              "title": "No",
              "value": "false"
            }
          ],
          "placeholder": "AT&T Fob",
          "id": "fob",
          "label": "AT&T FOB",
          "isRequired": true,
          "errorMessage": "Required",
          "style": "expanded",
          "title": "@{variables('FOB Choice')}",
          "value": "@{variables('FOB')}"
        }
      ]
    },
    {
      "type": "Container",
      "items": [
        {
          "type": "ActionSet",
          "actions": [
            {
              "type": "Action.Http",
              "title": "Save",
              "method": "POST",
              "url": "redacted",
              "body": "{\n\"starttime\":\"{{starttime.value}}\",\n\"location\":\"{{location.value}}\",\n\"fob\":\"{{fob.value}}\",\n\"size\":\"{{size.value}}\",\n\"id\": @{triggerOutputs()['relativePathParameters']['id']}\n}",
              "headers": [
                {
                  "name": "Authorization",
                  "value": ""
                },
                {
                  "name": "Content-Type",
                  "value": "application/json"
                }
              ],
              "style": "positive",
              "id": "save"
            },
            {
              "type": "Action.Http",
              "title": "Cancel Class",
              "style": "destructive",
              "ignoreInputValidation": true,
              "method": "POST",
              "url": "redacted",
              "body": "{\n\"starttime\":\"{{starttime.value}}\",\n\"location\":\"{{location.value}}\",\n\"fob\":\"{{fob.value}}\",\n\"size\":\"{{size.value}}\",\n\"id\": @{triggerOutputs()['relativePathParameters']['id']}\n}",
              "headers": [
                {
                  "name": "Authorization",
                  "value": ""
                },
                {
                  "name": "Content-Type",
                  "value": "application/json"
                }
              ],
              "id": "cancel"
            }
          ],
          "horizontalAlignment": "Left",
          "spacing": "Medium",
          "id": "cance"
        }
      ]
    }
  ]
}

Here are my flow steps. The first step has the code I pasted. enter image description here

1 Answers1

0

As far as I am aware the Action.HTTP is only used in actionable messages. Teams uses the Action.Submit instead.

There is a Universal action called Action.Execute which should cover both of them and you might able to use that one instead?
https://learn.microsoft.com/en-us/microsoftteams/platform/task-modules-and-cards/cards/universal-actions-for-adaptive-cards/overview?tabs=mobile#universal-actions

That control should also have a style property: https://adaptivecards.io/explorer/Action.Execute.html

Expiscornovus
  • 1,222
  • 1
  • 3
  • 7
  • Thank you, I will take a look at this. I am using actionable messages in outlook, since most of our staff don't use teams regularly. – Tristen Hannah Apr 25 '23 at 21:13