Power Automate Approvals Attachments With Dataverse Files
Power Automate Approvals Attachments With Dataverse Files Posted by - Matthew Devaney on - August 4, 2024 3 Comments Power Automate approval flows can includ...
- Published
- Reading time
- 4 min read
Before you start
Is this guide for you?
- Best entry point
- Power Automate
- Time investment
- 4 min read
Imported reference from Matthew Devaney's blog for learning purposes. Original: https://www.matthewdevaney.com/power-automate-approvals-attachments-with-dataverse-files/. Author: Matthew Devaney.
Power Automate Approvals Attachments With Dataverse Files Posted by - Matthew Devaney on - August 4, 2024 3 Comments
Power Automate approval flows can include attachments from Dataverse file columns file attachments. The approver is able to open the file and review it before choosing to approve or reject it. File columns and attachments lists must be handled different ways in an approval flow. I will show you both methods and provide templates you can use when building your own flows Table of Contents
Introduction: The Approval Flow With Dataverse Attachments Create A Dataverse Record With A File
Add Dataverse File Column To An Approval Action
Run The Approval Flow With File Column Attachments
Create A Dataverse Record With Notes & Attachments
Add Dataverse Attachments Files To An Approval Action
Run The Approval Flow With Dataverse File Attachments
Introduction: The Approval Flow With Dataverse Attachments
The finance department uses Power Automate approval flows to approve invoices and expenses. The approval attachments can come from a Dataverse table file column or the attachments.
Dataverse File Column Approval Attachments Create A Dataverse Record With A File
Open Power Apps and create a new table named Invoice Approvals . Add a file type column called Invoice File .
Insert the Invoice File field into the main form. Create a new record in the table and add a invoice to the field.
Add Dataverse File Column To An Approval Action
Go to Power Automate and start a new automated flow with the Dataverse – When a row is added, modified or deleted trigger. The trigger returns only a limited set of fields from the record so we must get a row by id to obtain the full details. Then we download the invoice from the file field so we can use its file content inside of the Create Approval action.
Use this code in the Attachment Name field of the Create Approval action. It will display the full file name and extension in the approval.
body( 'Get_a_row_by_ID' )?[ 'md_invoicefile_name' ] Code language: JavaScript ( javascript )
Run The Approval Flow With File Column Attachments
That’s all it takes to build the Power Automate approval flow with a file column attachment. Save the flow and add a new file to the library to see it run.
The approval action now includes a document file from Dataverse.
Dataverse Notes Table Approval Attachments
Create A Dataverse Record With Notes & Attachments
Go to Power Apps and create a new table named Supplier Expenses . Enable attachments for the table.
Add a timeline control into the main form. Insert several new notes with an attachment into a supplier invoice record.
Add Dataverse Attachments Files To An Approval Action
Start a new Power Automate flow with a Dataverse – When a row is added, modified or deleted trigger. List all of the rows from the Dataverse Notes table with an object id value matching the flow trigger id. Then for each notes record, check if it is an attachment and compose an attachment object to include in the approval. Add a create approval action, switch the approvals input fields to entire array and reference the compose action inside of the apply to each loop.
Filter the Notes table by using this odata query in the list rows action _ objectid_value
eq @{ triggerOutputs ()? [ 'body/md_supplierinvoiceid' ] } Code language: CSS ( css )
Compose the attachment object using this code. {
"name" : "@{items('Apply_to_each:_Note')?['filename']}" , "content" : {
"$content-type" : "application/octet-stream" ,
"$content" : "@{items('Apply_to_each:_Note')?['documentbody']}" } } Code language: JSON / JSON with Comments ( json )
Include this flow expression in the attachment field of the create approval action outputs( 'Compose:_Attachment' ) Code language: JavaScript ( javascript )
Run The Approval Flow With Dataverse File Attachments
Save the flow and modify the record with multiple attachments to see it run.
The flow approval appears with multiple attachments from the Dataverse record. Did You Enjoy This Article? 😺
Subscribe to get new Copilot Studio articles sent to your inbox each week for FREE Enter your email address Sign Me Up Questions?
If you have any questions or feedback about Power Automate Approvals Attachments With Dataverse Files please leave a message in the comments section below. You can post using your email address and are not required to create an account to join the discussion. Matthew Devaney Power Automate
Save Docusign Document To SharePoint With Power Automate
Tagged
Approvals · Dataverse · Power Automate
Have a Microsoft 365 topic idea?
Share article suggestions, community session ideas, corrections, or real-world scenarios for future nextM365 learning notes.
Keep learning Microsoft 365
Explore more practical guides for SharePoint, Power Platform, Copilot Studio, migration, automation, governance, and security.
Continue learning
Related tutorials
Related questions
Related comparisons
Next action