cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
koreluk
Frequent Visitor

Copy content from one Excel file to another template and save in a folder

Hi everybody!

I am trying to reperform a certain process with the Flow and yet have no idea if and how it can be done.

I will be very grateful if someone could give me a hint.

 

Process looks like this:

1. Sales manager sends approval form in Excel to Business Analyst (this form contains list of products with suggested prices)

2. Business Analyst copy the content of this form in another Excel template, where additional calculations are done (such as Gross Profit, Gross Margin etc)

3. After Calculations are performed the form is sent for approval to management

The main reason for this copy-paste job is confidential information on margin, which Sales manager should not see.

 

Is there any way to automatize the process?

 

Thank you very much!

 

 

1 REPLY 1
Community Support
Community Support

Re: Copy content from one Excel file to another template and save in a folder

Hi @koreluk,

 

Do you want to copy content from a Excel file attached to an email into another Excel file?

Has the data of your Excel file been formatted as a table?

Could you please share more details about your source Excel file and the template Excel file?

Further, where does your Template Excel file store?

 

There is no way to get the actual content of a Attachment file of an received email in Microsoft Flow currently, the Attachment content (Attachment Content dynamic content) we get is a binary data representation of the content of the Excel file. In addition, there is no way to analyze binary data in Microsoft Flow currently.

 

You could consider take a try with the following workaround as an alternative solution:

The Source Excel file shows as below:5.JPG

The Template Excel file shows as below:6.JPG

 

I assume that your Template Excel file is stored within your OneDrive for Business folder and the data of your Excel files are formatted as table, I have made a test, please take a try with the following workaround:

  • Add a "When a new email arrives" trigger, Has Attachment field and Include Attachments field both set to Yes.
  • Add a "Apply to each" action, input parameter set to Attachments dynamic content of the trigger.
  • Within "Apply to each" action, add a "Create file" action of OneDrive for Business connector, specify Folder Path, File Name set to Name dynamic content of the trigger, File Content set to Content dynamic content of the trigger.

         Add a "Get rows" action, File name set to Id dynamic content of the "Create file" action, Table name set to Table1 as a custom value.

 

        Add a "Apply to each 2" action, input parameter set to output of "Get rows" action. Within "Apply to each 2" action, add a "Insert row" action, File Name field set to the specific Template Excel file, Table name set to Table1. ProductName field set to following formula:

item()?['Product_x0020_Name']

Price field set to following formula:

item()?['Price']

Amount field set to following formula:

item()?['Amount']

Gross Profit field set to following formula:

mul(int(item()?['Price']),int(item()?['Amount']))

Note: The Product Name, Price and Amount are columns in my Source Excel file. In addition, if there is a space within the column name, please replace the space with '_x0020_' within above formula.

 

Under "Apply to each 2" action, add a "Delete file" action, File field set to Id dynamic content of the "Create file" action.

 

 

 

Image reference:7.JPG

 

8.JPG

The flow works successfully as below:9.JPG

 

10.JPG

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (7,530)