cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
PowerAppsDaniel
Level: Powered On

Iterating over Excel files and add rows from CDS

Hi Power Automate Community!

 

I'm in the middle of building a Flow and seems to have found a blocked path.

 

I have a OneDrive for Business folder with multiple only headers Excel files (expenses_{employeeName}.xlsx). I need this flow to be able to iterate over those files and add rows from CDS. The problem is I can't find a way to dynamically set the Excel file location in the Add rows connector.

 

Is there a workaround for this?

6 REPLIES 6
Super User
Super User

Re: Iterating over Excel files and add rows from CDS

Hi @PowerAppsDaniel 

 

Sorry for the bad news but I don't think you're able to define it. The connector will always add data to the end of the table :(.

 

Sorry for the bad news.

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

 

PowerAppsDaniel
Level: Powered On

Re: Iterating over Excel files and add rows from CDS

Hi @manuelstgomes,

 

Thank you for your answer but that isn't an issue in this case. I want to add rows to the end of the tables. The problem is I want to loop through the different Excel files and add rows to those in each iteration. In the loop, I want to be able to dynamically set the Excel file so that each iteration refers to a different Excel file (1 iteration = 1 employee = 1 Excel file).

Super User
Super User

Re: Iterating over Excel files and add rows from CDS

Hi @PowerAppsDaniel 

 

OH!! Now it makes sense :).

 

To cycle through the files you can use the following strategy:

 

 

The issue comes when you're trying to use the Excel action. When you define it with dynamic values, the columns won't be fetched, since Power Automation doesn't know the file until it's running so it cannot fetch the columns. You'll get something like this:

Screenshot_2019-12-13_at_10_33_05.jpg

 

So you can't add directly the value.

small-Screenshot_2019-12-13_at_10_33_05.jpg

 

The only solution to this is to map directly by name all excel files and, since Power Automation can see the structure, then you have fields to insert data. I know this sucks but it's the only way that I see that you can insert data.

 

Hope this helps you.

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

PowerAppsDaniel
Level: Powered On

Re: Iterating over Excel files and add rows from CDS

Hi @manuelstgomes,

 

What do you mean by "map directly by name all excel files and, since Power Automation can see the structure, then you have fields to insert data", could you elaborate a bit more on this idea?

 

Thanks.

Super User
Super User

Re: Iterating over Excel files and add rows from CDS

Hey @PowerAppsDaniel 

 

Sure. Here's what you get when you can define the full path and the table of the Excel:

 

small-Screenshot_2019-12-13_at_11_05_51.jpg

 

The issue with dynamically fetching Excel files is that you can't pre-define the tables and the structure so you can't add to the fields.

 

Does it make sense? 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

Community Support Team
Community Support Team

Re: Iterating over Excel files and add rows from CDS

Hi @PowerAppsDaniel,

 

Has your problem been solved by @manuelstgomes's advice?
If your problem has been solved, You could go ahead and mark the post as solved by clicking “Accept as Solution” so that this thread will be marked for other users to easily identify!

Best Regards,
Community Support Team _ Lin Tu

Helpful resources

Announcements
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!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (6,436)