Features

Connect Google Forms with IFlowly

Connect Google Forms with IFlowly

IFlowly is a lightweight microservice that helps us define the flow we need regardless of the data structure sent. Therefore, using IFlowly APIs, we can make the submitted inquiry from any form builder in the market route it's way to the desired flow we need.

In this article, we will walk through how to connect your google form with IFlowly in a couple of steps.

To begin with, let's create a google form.

We'll create a form to request an Acai bowl

Acai Google Form

Now we'll click on Script Editor in the menu bar, which will take you to code editor.

In Google Form code editor Code.gs, copy and paste this snippet.


var POST_URL = "https://api.iflowly.com/v1/entries/";
function onSubmit(e) {
    var payload = {};
    response = e.response.getItemResponses()
    for (var i = 0; i < response.length; i++) {
        var question = response[i].getItem().getTitle();
        var answer = response[i].getResponse();
        payload[question] = answer;
    }
    data = {}
    data['external_data'] = payload
    data['external_id'] = e.response.getId()
    data['external_data']['redirect_url'] = e.response.toPrefilledUrl()
    data["flow_id"] = "YOUR-FLOW-ID"
    var options = {
        "method": "post",
        "contentType": "application/json",
        "payload": JSON.stringify(data),
        "headers": {
          "X-Api-Key": "YOUR-API-KEY"
        }
    };
    Logger.log(data)
    UrlFetchApp.fetch(POST_URL, options);
};

What the script above does is on submission, it will call IFlowly APIs and trigger the flow to run. We want to make sure we're passing our X-Api-Key and flow_id.

We can get our Flow ID from IFlowly's URL. Example: https://{{workspace}}.iflowly.com/flows/view/39ff36b6-808c-4496-9476-76c1520411ae <-- Flow ID

We can follow the Docs for creating a new API Key

Once we've added the script and saved. We'll add now the trigger to call the method we just added. By going to triggers and clicking on Add Trigger

Summing up all the steps above. Here is a quick GIF with the steps.

That's it, we now have our Google Form connected with any flow we want this entry to follow. If you haven't created a flow yet to extract the Flow ID. Watch this video for creating your first flow in IFlowly, Sign up now for free