If you're sending surveys to your customers, colleagues, or friends or you're tracking leads from prospective customers it may be helpful to get a daily recap on how many responses you've received. In this tutorial, we'll outline how to configure two Applets that will use Google Sheets and some filter code to send you a daily recap.
In this example we'll create two Applets that will monitor how many responses have been received on a Google Forms survey then send a slack recap at the end of each day at 5 pm.
Depending on what services you use, the trigger in this example could easily be updated to similar services on IFTTT such as Facebook Lead Ads or Survey Monkey and the action could be updated to email, sms, or other similar notification actions.
Step 1: Use Google Forms to Track a Variable
Sometimes a service on IFTTT won't include a query that you're looking to use as part of your Applet. In this case, the Google Forms service doesn't include a query that can give us the number of forms submitted in a given time frame. This is where Google Sheets can be a powerful tool to track just about any data and use it in your Applet using the Current value of a cell or Current values of a row queries.
As a first step, create a new folder in your Google Drive titled IFTTT. Next create a Google Sheet in the IFTTT folder and title it "survey tracking". In cell A1 of the sheet enter 0.
Step 2: Use Google Forms to Track the number of Responses
Once your Google Sheet is created we can create an Applet that will track how many responses your Google Survey has received by following these steps:
Add a trigger:
- Navigate to the Applet Composer on IFTTT
- Press add to the right of If This
- Search for and select the Google Forms service
- Select the card titled New form response
- Select the form you'd like to monitor then press Create trigger
Add a query:
- After creating your trigger, you'll be returned to the Applet composer, press the + sign, then press the + to the right of Query
- Search for and select the Google Sheets service
- Select the card titled Current value of a cell
- Enter A1 in the Which cell? field
- Paste the URL of the "survey tracking" sheet created in Step 1
- Press Create query
Add an action:
- After creating your query, you'll be returned to the Applet composer, press add to the right of Then That
- Search for and select the Google Sheets service
- Select the card titled Update cell in spreadsheet
- Enter the folder path for the "survey tracking" sheet created in step 1 in the Drive folder path field and survey tracking in the Spreadsheet name field
- Enter A1 in the Which cell? field
- Enter 0 in the Value
- Then press Create action
Add Filter code:
- After creating your action, you'll be returned to the Applet composer, press the + sign between your query and action, then press the + to the right of Filter code
- Copy and paste the filter code below in the filter code editor:
let currentValue = GoogleSheets.cellValue[0].Value;
let newValue = Number(currentValue) + 1;
GoogleSheets.updateCellInSpreadsheet.setValue(String(newValue));
After saving your filter code, follow the remaining prompts to name and save your Applet. With the above set up, every time a new form response is submitted Cell A1 of the "survey tracking" sheet will increase by one. We can use that variable in step 3 in our daily notification.
Step 3: Use Date and Time and Slack to send a message each day
As a last step, we'll create one additional Applet that will post each day to Slack letting us know how many form responses were recieved that day based on the counter in the Google Sheet. This Applet will also include an action to reset the sheet's counter to zero.
Add a trigger:
- Navigate to the Applet Composer on IFTTT
- Press add to the right of If This
- Search for and select the Date and Time service
- Select the card titled Every Day at
- Set the Time for when you'd like the message to be send, for example 5 PM
- Press Create trigger
Add a query:
- After creating your trigger, you'll be returned to the Applet composer, press the + sign, then press the + to the right of Query
- Search for and select the Google Sheets service
- Select the card titled Current value of a cell
- Enter A1 in the Which cell? field
- Paste the URL of the "survey tracking" sheet created in Step 1
- Press Create query
Add the first action:
- After creating your query, you'll be returned to the Applet composer, press add to the right of Then That
- Search for and select the Slack service
- Select the card titled Post to channel
- Select the Slack channel of your choice in the Which channel? field
- In the Message, create a message and include the value ingredient from the Google Sheets query. For example: "Daily update: we've recieved {{GoogleSheets.cellValue.Value}} responses to our survey"
- Note: the value ingredient can be added using the add ingredient button then selecting the Current Value of a Cell trigger from the dropdown menu
- Press Create action
Add the second action:
This action will reset the counter in your Google Sheet back to zero.
- After creating the first action, you'll be returned to the Applet composer, press the Plus sign below your existing action to add a second action
- Search for and select the Google Sheets service
- Select the card titled Update cell in spreadsheet
- Enter the folder path for the "survey tracking" sheet created in step 1 in the Drive folder path field and survey tracking in the Spreadsheet name field
- Enter A1 in the Which cell? field
- Enter 0 in the Value
- Press Create action
Once you've created those two Applets you're all set and you'll receive daily updates to your Slack channel.