cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

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
Highlighted
Super User II
Super User II

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

 

Highlighted
Helper II
Helper II

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).

Highlighted
Super User II
Super User II

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

Highlighted
Helper II
Helper II

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.

Highlighted
Super User II
Super User II

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

Highlighted
Community Support
Community Support

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (9,821)