How to trigger a Control Room process from a Typeform submission

Typeform is a popular tool to create and manage online forms. In this article, we will see how you can trigger a process in Control Room when a user submits a Typeform using Webhooks.

You will need:

  • a Typeform account (this will work with a free account as well)
  • a Control Room account
  • Robocorp Lab installed and connected to your Control Room account

Get access to Typeform and create a form

Register or log in to your Typeform account and create a test form using the UI.

As an example, we have created a very simple form with three fields:

  • an email field
  • a text field
  • a numeric field (opinion scale)

Form overview in the Typeform UI

You can try the test form here.

Create a new process in Control Room and enable API access

  1. Access Control Room, select your organization and workspace and create a new process under the Workforce tab. For this example, we decided to set up a new workspace called typeform. In it we have created a process called typeform example process: Typeform workspace and process created
  2. Enable the API access for your workspace and take note of the key.

Add the webhook to your form in Typeform

  1. In the Typeform admin UI, select the Connect button in the top bar.
  2. Select the Webhooks button.
  3. Add a new webhook and add the URL that you got in the previous step: Typeform add new webhook
  4. Activate the webhook using the toggle button: Typeform activate webook

Add a new robot in your workspace in Control Room

Your process needs to have at least one step associated with it to run.

While in your workspace in Control Room, create a new robot. We decided to call it typeform.

Control Room - Add a robot

Create a new robot in Robocorp Lab

Our process is set up, but we have no robot added to it. Let's create one!

  1. Open Robocorp Lab and create a new robot: Robocorp Lab - Create a new robot
  2. Open the tasks.robot file in editor mode by right-clicking on the file in the sidebar, and selecting Open With -> Editor, replace the existing content with this script and save the file:
*** Settings ***
Documentation     A simple robot demonstrating how to get data from
...               a typeform submission.
Library           RPA.Robocloud.Items

*** Tasks ***
Get form submission data from Typeform and log it
    ${payload}=    Get Work Item Payload
    Log    ${payload}

Robot code explained

  • We are adding the RPA.Robocloud.Items library, that allows us to access the data coming from Typeform via the webhook.
  • ${payload}= Get Work Item Payload: Using the Get Work Item Payload keyword, we access the payload data coming from Typeform.
  • Log ${payload}: For now, we will just print out the content of what we get from Typeform to the log.

Upload the robot to Control Room

  1. Make sure that you have linked Robocorp Lab to your Control Room account
  2. Click on the Publish to Control Room button on the top right corner.
  3. Select your workspace and your robot in the UI and click on the Publish to Control Room button:

Robocorp Lab push to Control Room

Add the robot step to the process in Control Room

In Control Room, select your process and add to it the robot you just uploaded: Control Room - Add robot step to process

Submit the Typeform and see the results in Control Room

Submit your form in Typeform. This will cause the webhook to fire, and Control Room will run your process!

Control Room process started by api

When the process is complete, you can see the submitted values in the log:

Control Room - View log results

You can also inspect the data that was passed to the process using the Control Room UI:

Control Room - View work item

Next steps

Now you know how to set up Typeform and Control Room to run a robot when a form is submitted. Pretty neat!

You will probably want to do something with the data that you get from Typeform, so here are some pointers:

Learn more about the libraries mentioned on this page:

June 30, 2021