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

CSV Export remove blanks

Howdy everyone! I have browsed around here to find a solution and I have found a few that kind of do what I need but they're not exactly working for me.

 

My intent is to take a table from an excel file and export it as a CSV so that the data can be imported into our ERP system. However when I try to import the file it errors out because there are blank values in the exported CSV. This flow works great until it gets to the filter connection of the flow.

 

My hope was to add a filter to my current CSV export Flow to prevent any blanks from being added to the CSV but it keeps timing out. This is what I currently have:

gcwilliams07_0-1608841884256.png

Any help that yall could provide would be amazing, thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
tom_riha
Super User
Super User

Hello @gcwilliams07 ,

I think you could filter the empty rows already in the 'List rows present in a table' action by adding a 'Filter Query' to filter only rows where some column is not empty (column is not equal to ''). That will give you only the not-empty rows and you can store all of them in the .csv file.

Column ne ''

 image.png

To your current solution, the flow you currently have will not behave as you expect (I suppose). You're using 'Apply to each' on each of the rows, and then based on condition you create a .csv file. That means that if you have e.g. 20 rows in the table, the flow would do all the actions inside 'Apply to each' 20 times, and create a .csv file each time a row is not empty, e.g. with 20 rows, 2 of them are empty, the flow would create 18 .csv files (and I'm not sure if you even filter the empty rows from the result when creating the .csv). 



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

View solution in original post

4 REPLIES 4
v-bofeng-msft
Community Support
Community Support

Hi @gcwilliams07 :

Do you want to filter out items whose value in a certain field is empty?

If so,just need to add a condition to the condition:

1.JPG

Fill in the field you want to filter in the blue circle I marked.

Best Regards,

Bof

Thanks Bof for your suggestion, I tried that but get an 'get_file_content' failed error (see below):

gcwilliams07_1-1608933857178.png

 

tom_riha
Super User
Super User

Hello @gcwilliams07 ,

I think you could filter the empty rows already in the 'List rows present in a table' action by adding a 'Filter Query' to filter only rows where some column is not empty (column is not equal to ''). That will give you only the not-empty rows and you can store all of them in the .csv file.

Column ne ''

 image.png

To your current solution, the flow you currently have will not behave as you expect (I suppose). You're using 'Apply to each' on each of the rows, and then based on condition you create a .csv file. That means that if you have e.g. 20 rows in the table, the flow would do all the actions inside 'Apply to each' 20 times, and create a .csv file each time a row is not empty, e.g. with 20 rows, 2 of them are empty, the flow would create 18 .csv files (and I'm not sure if you even filter the empty rows from the result when creating the .csv). 



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

thank you! i was unaware of the filter on the "list tables" connector and after googling the documentation on it, I was able to get to successfully work! 

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.

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.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Users online (1,752)