Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
unknown917
Helper III
Helper III

Automate Flow to add rows to an existing file, save file as, email to end user

I have a manual trigger flow that adds rows to an excel template.  I'm wondering if number 1:  is possible once the flow is complete, to add an action to save the file as (ie.  'January '25 Sales' from 'Sales Template')?  Number 2:  send that new file to a dynamic email?  For instance, is it possible for the end user to select the email they wish to send it to before they trigger the flow?

This is a PBI report that I am looking to have the end user select certain criteria before triggering the flow.  If I bring in a list of email addresses into the model and create a visual that will allow them to select their email address, can I somehow create an action that will send the file to the email the end user has selected in the report?

Thank you in advance for any suggestions/assistance!

5 REPLIES 5
Anonymous
Not applicable

Hi, @unknown917 

May I ask if you have gotten this issue resolved? If it is solved, please share your solution and accept it as solution, it will be helpful for other members of the community who have similar problems as yours to solve it faster.

 

If it's not resolved, please share more details about the issue you're experiencing (excluding sensitive information) and we'll do our best to help you resolve the issue you're experiencing.

 

 

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Fen Ling,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Ritaf1983
Super User
Super User

Hi @unknown917 

Yes, you can achieve this in Power Automate with a few steps. Here’s a breakdown of how to accomplish each part of your request:

1. Save the Excel File with a New Name

After the rows have been added to your Excel template in the flow, you can use the "Create file" action in Power Automate to save it with a new name. Here’s how to do it:

  • Add a "Create file" action after your Excel operations are complete.
  • Specify the file path and set the file name dynamically, e.g., 'January '25 Sales.xlsx'. You can use the current date or other dynamic content to generate the file name.
  • This will save the file with the new name in your chosen location (e.g., OneDrive, SharePoint).

2. Send the File to a Dynamic Email

You can set up the flow to send the newly saved file to an email address selected by the user in Power BI.

Option 1: Use Power BI and Power Automate Integration

  • In Power BI, create a visual (e.g., a slicer) that allows the user to select an email address from a list (you can import this list of email addresses into Power BI as a data table).
  • Use a Power Automate button in Power BI to trigger the flow. When setting up the flow, you can configure it to accept the selected email address as input.
  • In Power Automate, use the "Send an email" action, and set the recipient’s email address as the selected email from Power BI.

Option 2: Manual Trigger with Dynamic Email Prompt

  • If using a standalone manual trigger in Power Automate (outside of Power BI), you can add a "Get user input" action at the beginning of the flow to prompt the user to enter the recipient’s email address.
  • This dynamic email address can then be passed to the "Send an email" action later in the flow.

Summary

  1. Add rows to the Excel template in Power Automate.
  2. Use "Create file" to save it as a new file with a dynamic name.
  3. Send an email with the new file attached, using either an email selected in Power BI or a prompt within the flow.

Helpful Resources

To assist you further, here are some useful guides:

  1. Attaching Files to an Email in Power Automate: This guide provides two methods for attaching files to emails within Power Automate, which is essential for sending your newly created Excel file. https://www.powertechtips.com/attach-files-to-email-power-automate/

  2. File Actions Reference in Power Automate: This Microsoft documentation offers a comprehensive overview of file actions available in Power Automate, including creating and manipulating files. https://learn.microsoft.com/en-us/power-automate/desktop-flows/actions-reference/file

  3. Creating Flows for Popular Email Scenarios: This article discusses various email scenarios in Power Automate, such as sending emails from your account or a shared mailbox, which can be useful when setting up your flow to send the Excel file. https://learn.microsoft.com/en-us/power-automate/email-top-scenarios

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

@Ritaf1983 

 

Thank you so much!

 

I haven't gotten to the end result yet, due to recieving an error for null values when adding rows.  I attempted adding the following to account for nulls:

 

if(empty(triggerOutputs()?['ColumnName']),'',triggerOutputs()?['ColumnName'])
 
but I now get this error when triggering the flow:
 

The input body for trigger 'manual' of type 'Request' did not match its schema definition. Error details: 'Required properties are missing from object: entity.'.

 

Any insight as to the error and if my expression is incorrect?

 

Again, thank you for your help!

Hi @unknown917 

Unfortunately, I don’t have much experience with Power Automate. When I need something simple, I stick to guides like the one I included in my first response.

I’d recommend maybe trying to write a new post with a detailed description of what you’re doing, including screenshots, and also consulting the Power Automate forum for additional help.

Here’s the link to the forum: Power Automate Community Forum

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile
hnguy71
Super User
Super User

Hi @unknown917 

For both, that's possible. Also, it depends where you would like to save the file to and what kind of file is being generated. Power Automate is robust enough to save a file.

For the second option, you could allow a user to select from a list of emails and then a measure would capture the inputs into a concatenated list and then have it the parameter fed into a Power Automate flow.



Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.