Hi,
I'm currently working on a flow which should download csv files that are received in a specific Outlook email address, and upload them to a sharepoint folder.
This is going well, but our follow-up work is disrupted by some csv files with only the column names, so without any data. My goal is to filter these csv files.
Unfortunately the incoming csv files cannot be altered as they're coming from an outside source.
The current flow setup is as follows:
- Only select emails with attachments and other necessary requirements.
- Concatenate the current datetime + attachment name.
- Save the file to a specified Sharepoint folder with the new name.
Are there any suggestions of ways that I could solve this? Help is greatly appreciated.
Solved! Go to Solution.
Hi!
I think you need to read the CSV file and check if more than one rows is defined (i.e. it contains valid data other than just headers), right?
Good stuff here
https://sharepains.com/2020/03/09/read-csv-files-from-sharepoint/
Following this link's recommendations you can calculate nr of elements contained by 'Filter array' output with the following expression
length(body('Filter_array'))
If 1, then delete the CSV file.
Hope this helps
Proud to be a Flownaut!
Hi!
I think you need to read the CSV file and check if more than one rows is defined (i.e. it contains valid data other than just headers), right?
Good stuff here
https://sharepains.com/2020/03/09/read-csv-files-from-sharepoint/
Following this link's recommendations you can calculate nr of elements contained by 'Filter array' output with the following expression
length(body('Filter_array'))
If 1, then delete the CSV file.
Hope this helps
Proud to be a Flownaut!
Hi efialttes,
I tried implementing the solution you offered, and it worked!
I had some issues with the
outputs('Newline')
part of the script on the site. I used a workaround in which I made a 'compose' step, in which I just entered '\n' as the input, which solved the issues.
Thanks again!