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):
How it looks when I choose something in the AT&T FOB drop down:
And in Designer - Adaptive Cards
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.