CSV File contains just field names

Discuss RoboTask here
Post Reply
sarnusch
Posts: 61
Joined: Thu Apr 28, 2022 9:05 am

CSV File contains just field names

Post by sarnusch »

Hello,

I just updated to Version 10.3.2.311 and noticed that the action 'SQL Query to CSV File' creates a file even if there is no data in the query.
The CSV file just contains field names.
In my case I want to check if there are new entries in the database, then create a CSV file with the data and send it via mail to a user.
Before I send the mails I checked if the file exists. If it exists there have been new entries and I have sent the CSV via mail. But if it does not exist the mail has not been send.

Now the file is send even when there is no new data because the file is created with field names.

It seems to be a new behaviour. Can it be deactivated?
sarnusch
Posts: 61
Joined: Thu Apr 28, 2022 9:05 am

Re: CSV File contains just field names

Post by sarnusch »

I made a rollback of the server and checked the changelog:

Screenshot 2025-04-24 125541.png
Screenshot 2025-04-24 125541.png (8.07 KiB) Viewed 1648 times

In my opinion the improvement is not good.
I need the headers only if the query returns data. If there is no data the file should be empty. Or you should be able to choose whether the header is written even if the query is empty
Oleg
Site Admin
Posts: 3200
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: CSV File contains just field names

Post by Oleg »

Download fresh version.
We have added option to "SQL query to CSV file" action to disable file creation if query returns empty result.
Oleg Yershov
Post Reply