These days a speedy-paced business environment and efficient reporting equipment are crucial. Dynamics 365 is a powerful CRM and ERP answer that offers robust reporting capabilities. However, exporting those reports in a consumer-friendly format, like PDF, can on occasion be difficult. Fortunately, Power Automate gives a streamlined way to automate this method. In this blog, we’ll explore a way to install waft that permits you to easily download Dynamics 365 reports as PDFs.
Power Automate (formerly referred to as Microsoft Flow) allows users to create automatic workflows between various applications and offerings. By using Power Automate, you may:
Step 1: Set Up Your Environment
Before you start, ensure you have the necessary permissions in Dynamics 365 and access to Power Automate. You’ll need a valid Dynamics 365 account and the reports you want to export.
Step 2: Create a New Flow
– Trigger: we have used manually triggered flow
Step 3: Add Dynamics 365 Action
– Filter the rows based on specified criteria, and the list will return the corresponding output.
– For example: In the image above, if the name equals ‘XYZ Report,’ the output will return to the record where the name is ‘XYZ Report.’
Step 4: Setup the Report Viewer
Method: POST
URL of the request: /CRMReports/rsviewer/reportviewer.aspx
Headers: Content-Type: application/x-www-form-urlencoded
Body of the request: id= items(‘Apply_to_each_on_XYZ_report_to_run’)? [‘reportidunique’] &iscustomreport= items(‘Apply_to_each_on_XYZ_report_to_run’)? [‘iscustomreport’] &CRM_Filter= outputs(‘CRM_Filter’) &reporttypecode=items(‘Apply_to_each_on_XYZ_report_to_run’)? [‘reporttypecode’]
This step runs for each report records retrieved in the previous step.
This step sends a POST request to a reporting system (/CRMReports/…) to run a specific report (e.g., “XYZ report”).
The request includes parameters like the report ID, custom report name, and type, dynamically populated from earlier steps.
Step 5: Generate PDF
Step 6: Download and Save the PDF
Step 7: Create an email record
Create an email record to make an email record in CRM
Add a step to attach the pdf with an email
Here we made an email record in CRM as we need to attach the PDF file to the email.
To send an email to outlook one must add the step” Perform bound action”.
Also one must check that the mailbox of the user triggering the flow is configured as without mailbox configuration the mail won’t be sent
Step 8: Test Your Flow
Once your flow is set up, it’s crucial to test it. Trigger the flow and verify that the PDF is created and saved correctly. Make any necessary adjustments to ensure smooth operation.
© All Rights Reserved. Inkey IT Solutions Pvt. Ltd. 2024
Leave a Reply