Hi everyone,
I'm trying to build a Workflow that retrieves some data from the database and sends it as a CSV via email. My workflow has 3 blocks:
- A PostgreSQL query retrieving the data
- A JS block running "Papa.unparse" over the retrieved data to transform it to the CSV format
- A SMTP block to send the data via email
Everything is working fine up until the unparse, but I'm not sure how I can make use of the data returned by the JS and plug it into the SMTP query so it's sent as a CSV file via email.
Here's an image of where I'm stuck at. In the SMTP query, I clicked "fx" to set the value dynamically. I then tried using both "{{code}}" and {{code.data}}" as a value, but I then get the error below when I try to run the SMTP block: