cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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!

 

 

2 REPLIES 2
v-xida-msft
Community Support
Community Support

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.
Anonymous
Not applicable

Hi, 

Notice that the action in the flow was no longer can be found in Microsoft Flow. I could not find "get rows" but only "get a row" available. Could you please advise if any other action can replace "get rows"? As when I replace "get rows" with "get a row", it need to specify certain file where "get rows" no need. 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,368)