Creating approval workflow with file attachments from SharePoint list item — Power Automate (Flow) recipe
In Power Automate (Microsoft Flow), it’s very common to start an approval workflow for scenarios like work order approval, purchase order approval, expense approval etc. It gets a bit complicated when that item has multiple attachments and you also want to include those attachments in the approval workflow.
Following video tutorial shows you how to implement this requirement.
What’ll you learn by building this?
By building this, you’ll also learn following concepts about Power Automate:
a) Array variables — Initialize & Append (to store the attachments)
b) Getting attachment content from SharePoint list is a 2 step process:
b.1) Get Attachments (list of attachments but not the content)
b.2) Get Content of each of these attachments (using Apply to each)
c) Right JSON format to use for each attachment (this JSON format is a bit different from the ones used for email notification. See our article on email notification with attachments for the JSON format difference)
d) Including attachments variable in approval creation
e) Quick Testing
A very important takeaway from this tutorial
If you want to remember just one thing from this tutorial, remember that if you want to attach multiple files in “create approval” step, you have to have an array consisting of JSON objects in a very specific format:
[
{
“Name”: <Name of the attachment-1>,
“Content”: <Content of the attachment-1>
}
,
{
“Name”: <Name of the attachment-1>,
“ContentBytes”: <Content of the attachment-1>
}
]
Related tutorial — Attachments in Power Automate email notification
We posted an earlier tutorial to show you how to implement something similar for email notification in Power Automate with attachments from SharePoint list. You’ll see that this JSON format needs to change for implementing that requirement. A bit weird but that’s how Power Automate expects it, so you have to comply with that requirement.
Subscribe to us to not miss these useful tips and tricks on Microsoft Power Platform — PowerApps, Flow (Power Automate), Common Data Service (Dataverse) etc.
For Training, 1:1 coaching, Newsletters, or Consulting help on Power Platform, Azure, or Data Science, please email us at hello@cloudatica.com or book a session at https://cloudatica.com Checkout our articles on https://cloudatica.medium.com