If you have ever wasted time on fetching data from a SQL database, downloading it to a CSV, then uploading that to Google Sheet, you might be interested in this Template.
In Query.me Notebooks you can now connect to a google sheet just like you would to SQL database. Using that integration we can either write our data straight into the Spreadsheet, or fetch data from Google Sheets to use in our workflows.
1) Create or Edit the SQL-block in the Template:
Unless you want to send multiple messages, your SQL should be a LIMIT 1
.
Every column returned by your query can become referenced data in your Slack message.
2) Create or Edit the IF
statement in the Template.
Reference the column and set a condition that should trigger blocks inside your statement.
Feel free to combine IF
and FOR
, and also use more blocks, like Email, inside the statement.
3) Create or Edit the Slack-block in the Template:
Design your message and simply reference data using JINJA
.
E.g.: {{ query_1.data()[0]['column_name']}}
Find out more about message styling and Slack's Block-kit-builder.
4) Don't have Slack webhook yet?
Simply follow the link on the bottom of the Slack-block to create one.
5) Test your design: Press play ▶️
Get immediate feedback on what your Slack message looks like.
INSERT
statement to Google SheetsIf you have ever wasted time on fetching data from a SQL database, downloading it to a CSV, then uploading that to Google Sheet, you might be interested in this Template.
Sign up and start using Query.me for free.
Or schedule a demo and talk to us.