How to wish a subscriber a happy birthday with a bot

Views:478

In this guide, Svetlana Gizatulina explains how to set up automatic birthday greetings in a bot using puzzlebot and Google Sheets.

Step 1 — Connect your bot to puzzlebot

You can find out how in the Knowledge Base: https://help.puzzlebot.top/article?r=3&a=18

Step 2 — Integrate with Google Sheets

Setup overview (part 1).

1. Open Settings in puzzlebot and go to the Integrations tab.
2. Connect your Google account and accept the permissions.
3. Make sure your account appears in the Google Sheets field.

Step 3 — Prepare Google Sheets

Лист для записи данных из бота

Sheet for data from the bot.

Add column headers for the data:
Column A — for the ID.
Column B — for the date of birth.

Лист для "расчета"

Sheet for "calculations"

1. Add column headers for the data and insert the formulas:
Column A will copy the ID from the data sheet using the formula: “='Даны из бота'!A2”
Column B will copy the date of birth from the data sheet using the formula: “ ='Данные из бота'!B2"
Column C will store the user's birth day using the formula: "=ТЕКСТ(ДЕНЬ(B2); "00")"
Column D will store the user's birth month using the formula: "=ТЕКСТ(МЕСЯЦ ) ) ( B2); "00")"
2. Select the rows and drag the formulas down to cover the expected number of subscribers.
3. Copy the link to the spreadsheet and save it to use in puzzlebot.

Step 4 — Set up the date of birth request and saving it to the sheet

Setup overview (part 2)

1. In the Constructor section, create a command that asks the user for their date of birth.
2. In the new command, open the Actions section, choose Create a row in Google Sheets, add the variables and save the changes.
3. Connect the commands and upload the changes to the bot.
4. Test the command.

Step 5 — Set up a daily birthday check and greetings

Setup overview (part 3)

1. In the Variables section, create two personal integrated variables to store the user's birth day and month.
2. In the Constructor section, create a command with the greeting.
3. Create a Condition that checks whether the user's birth day and month match the current date. If they match, send the greeting command; if not, do nothing.
4. Upload the changes to the bot.
5. In the Scenarios section, create a new scenario with 1 post that runs the Condition check every day at the specified time.
6. In the Constructor section, in the chain where the date of birth is requested, set the scenario to start.

Test the bot from any account. The setup is complete.

Want to ask an expert a question? Leave it in the comments under the latest post in our channel — the most interesting ones will get a detailed breakdown.

Was this page helpful?