Get a Demo

 

The Meta API integration platform-as-a-service (iPaaS) empowers your developers, data analysts, and IT admin to connect applications and data quickly. 

4 min read

Use case Typeform x Discord: be notified on Discord when somebody responds to your survey

Making questionnaires can be very useful for your company. Indeed, there are many types of surveys that allow you to get precious information. For example, you launch a new product or a new service, and you wish to get feedback from your buyers/users to improve your new products/services. You can also create a questionnaire to know better your target and understand their needs.

At Meta API, we have launched Lumo, our new Low Code interface. Many users have tested it in the preview, and we have created a feedback survey. We created it with Typeform, and we wanted to follow the answers from our Discord communication tool. To make sure we don't miss any answers, we connected Typeform and Discord to be notified as soon as someone answers our survey on Lumo. We present you how to send a notification from automation, below, step by step.

Summary:

Connect applications: create a spell with Typeform and Discord
Discover Lumo, our low-code interface
Use Lumo with a webhook in Typeform
Choose your connector among a catalog of +550 APIs: Discord
Use the Block Function to create your message in Discord
Set your Discord block
Putting your spell into production

 

Connect applications: create a spell with Typeform and Discord

A Spell is a mix between connectors and your code, put together to automate actions and data exchange between APIs. They are the consecration of our vision: making two APIs talking between each other and having the power to automate it. Once done, a Spell is exposed through an API endpoint, its own API, to be used anywhere outside the platform.

To get started, go to the Meta API platform. Click on “Create a New Spell”. We'll create a Spell with our new low-code Lumo interface, allowing you advanced workflows.

Untitled (9)

Discover Lumo, our low-code interface

The Lumo interface is made of nested block, each one responsible for one action, and that will be executed from top to bottom.

Untitled (11)

Discover the overview of our low-code interface.

In this use case, we will use the Payload to retrieve the data from Typeform using a webhook, then we will create a block function to create the message to send to Discord, and, finally, we will add the Discord connector to receive the message in the right channel.

Here are some details on the blocks we will use next:

  • Block Payload is a special block: it appears only once and will be at the top of your Spell. This block will contain all the data if your Spell is triggered by a webhook or manually. You can edit it to customize your example data during development.
  • Block Variable: declare a new value under a name to use it (and re-use it) inside your blocks. Perfect to use the same value multiple times.
  • Block Connector: to use an app or services (through his API), for retrieving or pushing data

Use Lumo with a webhook in Typeform

We will connect the payload from a Webhook. Click on edit and click on “Update Payload from Webhook”.

Untitled (12)You will find your webhook URL to copy and paste in your Typeform account.

2-2In your Typeform account, go to your questionnaire, click on Connect then Webhook. Paste the URL and do Save webhook.

3-3

/!\ This URL will be changed when the Spell is in production.

You can send test request from Typeform webhooks and check for data from Meta API to be sure it’s working.

Untitled (13)

Click on Save this Payload & continue.

Your Payload is configured with the Typeform webhook:

Untitled (14)

 

Choose your connector among a catalog of +550 APIs : Discord

Choose your connector by clicking on Block Connector.

Untitled (11)

In this example, we want to send a notification in Discord as soon as someone answers my survey, so select the Discord connector:

Capture d’écran 2022-11-15 095339

Choose the endpoint: we will choose the endpoint “POST Create message" allowing you to post a message in one of your channels.

Untitled (16)

We will configure it after the Block Function step.

 

Use the Block Function to create your message in Discord

We have configured the payload via a Webhook on Typeform, so we have all the information on our questionnaire. We are now going to set up the message that we want to receive on Discord as soon as someone answers our questionnaire.

I will create a Function block, I rename it in order to know what this block corresponds to.

5-5

I then configure my parameter which will be "form_response" and the type of return I want which will be "string".

6-6

In the code part, I will create my message that I want to receive in Discord.

For example, I want to receive : "Hello Meta API Team, a new response has been received on [QUESTIONNAIRE NAME] from [EMAIL]”

So I start by writing my message in the code part starting with return. I write the beginning of my message and to make the name of the questionnaire go up automatically, I find the information in my payload:

7-7

So I will write:

${form_response.definition.title} to bring up the name of my questionnaire in my Discord message.

Untitled (17)Then I continue writing the rest of my message: from, and I want to see the email of the person who replied to my survey. I go back to find the information in my Payload, I find it in the “answers” section, on line 3, and because I want the email:

8-8

9-9

The number of lines will depend on the number of questions, for this example, I have 3 questions before the person adds his email. So I add in my code after from ${form_response.answers[3].email}

Untitled (18)

 

set your Discord block

Go to your Discord and choose the channel in which you want to receive notifications, copy the link.

Untitled (19)

Paste the link in the settings of the Discord block, section channel.id, take only the last ID of the URL.

10-10

In the configure section, remove the code that was added by default, keeping "content" to add the message that we have set up with the function block. To do this, add its ID:

Untitled (20)You can launch the run to see if there are any problems with your settings. You will then receive a test notification on your Discord.

notif discord

 

Putting your spell into production

Your Spell is still in development mode, you need to put it in production to make it work in real time. Click on Publish, uncheck the "This is a draft" box and Publish on Production.

Untitled (21)

Once in production, your Spell URL retrieved from Meta API at the beginning will be different. You must then update it in the wehbooks of your Typeform account. So copy the new URL of your Spell in Prod.

12-12

Replace the URL on your Typeform account, Edit webhook.

Untitled (22)

 

4 min read

Use case Typeform x Discord: be notified on Discord when somebody responds to your survey

Making questionnaires can be very useful for your company. Indeed, there are many types of surveys that allow you to get precious information. For...

lumo low code workflow automation

3 min read

Meet Lumo, the new low-code automation platform by Meta API!

At Meta API, we just released our brand new low-code platform: Lumo. After 3 weeks of beta testing by our best users, we finally made it public on...

4 min read

Business benefits of an API integration platform

With the rise of low code tools, API integration platforms are rising as well. API integration platforms allow you to connect multiple APIs in one...