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

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

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

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
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MSFTBizAppsLaunchEvent

Experience what’s next for Power Virtual Agents

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Users online (50,105)