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

Get columns headers in excel file and copy them into a new excel file

Hi everyone,

 

I hope you could help me with this, since I am new in the use of Microsoft Power Automate. 

 

I have an excel table with different columns as in figure:excel table.PNG

 My objective is to retrieve only the header of the columns A, C and D and paste them into a new table in a new worksheet/file.

How can I do that?

 

Thank you in advance.

 

Helen

5 REPLIES 5
Community Support
Community Support

Hi @Helen96,

 

You could use the Select action to filter these columns you want, please refer to the following screenshot, then you will get the output of Select, put the output into the Apply to each action to get each row of the new table. Then add these rows into a new table by using the Add a row into a table action. Please notice here, when you map the table, you should use the expression that item()?['columnName'].

Annotation 2019-12-09 164147.png

Hope it helps, if you have any question about it, please contact us.

 

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

Thank you for the help, it worked. 

 

Can I ask you why it is necessary to use this expression to map the table? (item()?['columnName'].)

 

Moreover, in the column 'ONo' there are duplicates for each unique value, it is possible to have in the new table only distinct values?

 

For example, to be more clear, as shown in the following tables, there are five rows with a 'ONo' equal to '1726', five for '1732' and five for '1734', I would like to have only three rows in the new table, one for each different number (i.e. one for 1726, one for 1732, and one for 1734).

excel table.PNG

 Thank you in advance.

 

Helen 

Hi @Helen96

 

The item() is the current object of an array, the "?" is the operator to get value, and the ['columnValue'] is to input the name of the property you want to get.

 

The other four rows with the same ONo should delete? or add to the one row.

If you want to delete them, and then add the one row into a new table, you can use the Apply to each action to only add the 5th row into a new table.

 

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

Hi @Helen96,

 

These are steps that how to do it:

Annotation 2019-12-10 161814.png

 

Annotation 2019-12-10 161828.png

 

Annotation 2019-12-10 161840.png

 

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

Thank you again for helping me.

 

Actually, the thing that I would like to do is something like that: 

excel table.PNG

 I have this table where there are three different ONo, i.e. 1726, 1725, and 1729 (but the whole table contains more) each one has a different PNo, i.e. 3000, 3001, and 3002 (only these three numbers exists as PNo), then as you can see there is the StepNo that for a 3000 are 10, 20, 40, 80 and 200 (for a total of 5); for a 3001 are 10, 20, 40, 50, 70, 200 (for a total of 7); and for a 3002 are 10, 20, 30, 40, 50, 60, 70, 80, and 200 (for a total of 9).

 

The output that I would like to have using MS Power Automate is something like that: 

new excel table.PNG

Each row corresponds to one ONo, so I would like each ONo to appear only once. To each ONo corresponds only and only one PNo, then for the StepNo I would like to add a column for each of them (i.e. 9 columns) and then use and indicator as (1,0) or (yes,no) depending if the StepNo appears in the original table for that specific ONo or not. 

 

I hope that my objective is clear, otherwise please tell me and I will try to explain it better. 

 

Thank you so much, I appreciate the help you are giving me.

 

Best regards,

Helen

Helpful resources

Announcements
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (73,862)