ScenarioA specific connection between applications in which data can be transferred. Two types of scenarios: active/inactive. More: Update data in a Google Sheet to send a message to a Discord channel via the HTTP moduleThe module is an application or tool within the Boost.space system. The entire system is built on this concept of modularity. (module - Contacts) More. This scenario watches an existing Google Sheet and is triggered when data from a row is modified.
Level of difficulty: Easy
Implementation Time: Approximately 20 Minutes
Prerequisites: The following is needed to set up this scenario:
-
A Google Sheet with column names and existing data.
-
A Discord account with permission to manage webhooksA webhook is a way for an app to send real-time information to a specific URL in response to certain events or triggers. for a text channel.
The scenario for this tutorial contains only two modulesThe module is an application or tool within the Boost.space system. The entire system is built on this concept of modularity. (module - Contacts) More and looks like this:
-
Configure your sheet.
As mentioned under prerequisites, you must have a Google Sheet configured with column names and some sample data. If you don’t, please create one before you proceed. This is what mine looks like:
-
Create a WebhookA webhook is a way for an app to send real-time information to a specific URL in response to certain events or triggers. in your Discord Channel
Discord gives you the ability to create one or more webhooks for each text channel. If you’re not familiar with the process, follow the 3-step instructions below or else, jump to Step 3.
-
Under TEXT CHANNELS, click the settings icon next to the channel name:
-
Head over to the Webhooks tab from the left menu and click the button labelled Create Webhook:
-
Give the Webhook a name, copy the webhook URL, and click Save:
Keep this URL handy, we will need it while setting up the HTTP module in our Boost.spaceCentralization and synchronization platform, where you can organize and manage your data. More IntegratorPart of the Boost.space system, where you can create your connections and automate your processes. More scenario.
-
-
Head over to your Boost.space Integrator dashboard to create a new scenario.
-
Click the big question mark to set up Google Sheets as the first module and select Watch a worksheet as the triggerEvery scenario has a trigger, an event that starts your scenario. A scenario must have a trigger. There can only be one trigger for each scenario. When you create a new scenario, the first module you choose is your trigger for that scenario. Create a trigger by clicking on the empty module of a newly created scenario or moving the....
-
Choose your Google connectionUnique, active service acces point to a network. There are different types of connections (API key, Oauth…). More or add a new one followed by selecting a file (the sheet you created earlier) and the worksheet in the file that contains the sample data. Under Maximum number of returned rows, type in the number of messages you’d like to send every time the scenario runs. If you’d like to send a separate message for each updated row, type in 1 as shown below:
-
After clicking OK, you’ll see another dialog box asking you to either enter the row number from which you’d like the module to start looking for updates or select All rows.
Note The first row or header row is always assumed to contain the column names. Hence, if you enter 1, entries will be watched starting the row below the header row.
-
-
Configure the HTTP module as the Action
The HTTP module is the second and the last module in the scenario that performs the action of sending a message to a discord channel.
-
Search for the HTTP module and select Make a request as the action:
-
Under URL, paste the Webhook URL obtained from the Discord channel earlier.
-
Under Method, select POST.
-
Under Body Type, select Raw.
-
Under Content Type, select JSON (application/json).
-
Finally, under Request Content, type in the message to be sent to the channel as a JSON payload as per Discord’s API. To send a message (string), the Field type is content, hence the JSON payload should be written as follows:
“content” : “Houston, this is a message for Discord”
Click here to learn more about executing webhooks on Discord.
Since the trigger is a Google Sheet with columns containing data, we can use the column names to include the contents of each cell in the message that is sent to the channel. We may also use line breaks (\n) in the message. Below is what I have composed:
“content” : “**Incoming Status Update**\nName: {{firstname}} {{lastname}}\nMission: {{mission}}\nStatus: {{status}}”
-
Click OK to complete the scenario. You must save the scenario and toggle the SchedulingBoost.space Integrator allows you to define when and how often an active scenario runs. Use the Schedule setting panel under the Options tab and choose Scheduling to set your preferred schedule. More switch to ON.
-
To define the schedule for the scenario, click the little clock icon next to the toggle switch or the big clock animation on the Google Sheets module image as shown below:
-
You may also rename the modules and add notes under each by right-clicking the module image:
That’s it. Now update some data in your sheet and run your module once to make sure everything works fine as shown below:
-
Hope you were able to implement this scenario with ease.