Difference between revisions of "Qubot Google Sheets Setup"
| Line 35: | Line 35: | ||
<br> | <br> | ||
<br> | <br> | ||
| − | + | Share the access in any of the possible ways. | |
| − | + | First way. Share with a specific account: copy the following account into the input field of the sharing window and send the invitation. | |
'''qudata-bot-service@qudata-services.iam.gserviceaccount.com''' | '''qudata-bot-service@qudata-services.iam.gserviceaccount.com''' | ||
| Line 44: | Line 44: | ||
<br> | <br> | ||
<br> | <br> | ||
| − | + | Second way. Get shareable link: in the Get link section change status Restricted to Anyone with the link, and click Done. | |
<br> | <br> | ||
<br> | <br> | ||
| Line 50: | Line 50: | ||
<br> | <br> | ||
<br> | <br> | ||
| − | + | Please note that you can control the access: if the bot will only read data from Google spreadsheet, then the Viewer role is enough, and if the bot will also save data to Google spreadsheet, then the Editor role is required. You can change the role at any time in the sharing settings. | |
| − | |||
| − | |||
| − | == | + | == Step 4 == |
| − | + | Set up data loading to a spreadsheet in the bot editor. Additional information about this can be found in the bot editor templates (e.g. Trivia, Order Food templates) or in our help center. | |
| − | |||
== Настройка работы с данными Google таблиц в боте == | == Настройка работы с данными Google таблиц в боте == | ||
Revision as of 18:23, 28 June 2022
Connecting Google Sheets to a Bot
By connecting your Google spreadsheets to the bot, your bot experience will improve significantly. For example, your bot will be able to download data directly from your Google spreadsheet, as well as upload new data in real time. Using Google Sheets will make your work much easier, because you will have direct access to read and edit the saved data at any time without interfering with the bot code.
The instructions below will help you to share Google spreadsheets:
Step 1
Sign in or create an account at https://accounts.google.com
Step 2
Open your Google Sheets here https://docs.google.com/spreadsheets
You can also access your Google Sheets from the Google homepage(https://www.google.com/) by clicking the Google apps button.
Step 3
Share the Google Spreadsheet with your bot:
In your Google Sheets, open a spreadsheet and click the Share button.
Share the access in any of the possible ways.
First way. Share with a specific account: copy the following account into the input field of the sharing window and send the invitation.
qudata-bot-service@qudata-services.iam.gserviceaccount.com
Second way. Get shareable link: in the Get link section change status Restricted to Anyone with the link, and click Done.
Please note that you can control the access: if the bot will only read data from Google spreadsheet, then the Viewer role is enough, and if the bot will also save data to Google spreadsheet, then the Editor role is required. You can change the role at any time in the sharing settings.
Step 4
Set up data loading to a spreadsheet in the bot editor. Additional information about this can be found in the bot editor templates (e.g. Trivia, Order Food templates) or in our help center.
Настройка работы с данными Google таблиц в боте
Выберите нужного вам бота. Зайдите в Editor(Редактор) бота.
Загрузка данных с таблицы
1. Выберите нужный шаг в вашем боте где нужно загрузить данные с google таблицы(К примеру Main).
2. Выберите/создайте элемент, действием которого должна быть загрузка данных с таблицы. Это может быть Buttons(кнопка), элемент Actions(действие), просто ввод любого текста пользователем(click to show actions when) и другие элементы.
3. В поле Item properties у вас появится возможность добавить свойство:
4. Выберите свойство load:
5. В свойстве load выберите из списка Google Sheets
6. В поле Google Sheets table url введите url(ссылку) вашей google таблицы
7. В поле Slot name введите имя переменной, в которой будут хранится данные с вашей таблицы в виде массива объектов:
Используйте эту переменную для работы с вашими данными.
Убедитесь, что вы дали доступ на чтение или редактирование своей таблицы
Запись данных в таблицу
Пройдите шаги 1-3 описанных выше в "Загрузка данных с таблицы" выбрав шаг на котором нужно сделать запись в таблицу.
4. Выберите свойство save:
5. В свойстве save выберите из списка Google Sheets
6. В поле Google Sheets table url введите url(ссылку) вашей google таблицы
7. В поле Data value введите данные, которые будут записаны в таблицу в указанном формате в виде объекта:
Убедитесь, что вы дали доступ на редактирование своей таблицы