Database query to excel file

Hello everyone, I’m working in a flow that takes care of extracting from the database, by means of a select, a datatable and I would like to write it to an excel file every line it finds.
Unfortunately, the file always comes out empty, what am I doing wrong?


Could you please use output data table activity to store in a string and return the value using log message and see whether you are getting data from db or not. i don’t see any issue in your code. thanks.


Hi @Araceli91

Check wheather the OutPut Variable from the Execute query has Duplicated by Seeing in variable panel!


Good point @pravin_calvin.

1 Like


Please follow these steps to validate your steps

  1. First let’s check the sql statement
    Try running the same statement in your database sql server and see whether it is returning any value

  2. If it returns it’s fine and if not check the sql statement

  3. Then if it is working fine in database let’s check with the property panel of execute query
    Especially check for the common type property
    Is it set to text or tabledirect

In your case use Text as it Executes the query given in the SQL parameter

  1. Then use a log message activity next to that Execute query activity where mention like this to validate whether it has got any data


If it’s more than 0 then it will write to excel

  1. And finally to validate with write excel check whether folder path is correct
    ensure add headers property is enabled

Cheers @Araceli91