Member-only story

How To Turn Your Google Form Into a Telegram Bot

Make a telegram bot that asks questions and fills the answers in a Google Form

Danil Vityazev
Better Programming
3 min readAug 2, 2021

--

Bots automating tasks
Just like industrial robots once took routine jobs, turning some Google Forms into bots helps to automate submitting reports which gives humans more time to do creative tasks. Photo by David Levêque on Unsplash

Here is the case: there is a company that requires its’ workers to fill out a Google Form on a daily basis. The form is not the friendliest interface for an action that had to be performed daily, so the majority of workers skipped it and filled the form out multiple times at the end of each month, which was unacceptable. So here’s what I did.

I made a telegram bot that asks all the workers questions every day, then fills the answers into the form and submits them. Some fields are filled in automatically, such as the date of the submission and a username.

Sending an HTTP request

The form to be automated looks like this.

Let’s write a script that automatically submits the form with the information that 10/10 employee 1 had a status 2 with the comment like “Automated submission.” Every time the form is submitted a web browser sends an HTTP request to the server. The script has to send such a request instead of the browser.

First of all, we need to figure out the id of each field in the form. To do that, you right-click, “inspect element” on each field, and look for the number that looks like…

--

--

Danil Vityazev
Danil Vityazev

Written by Danil Vityazev

PhD candidate, Data Scientist. I make mathematical models of business processes to help people make decisions. vityazevdanil@gmail.com

No responses yet

What are your thoughts?