
You can integrate Microsoft Azure Forms with Synerise to collect data from the forms in Synerise and create new customer profiles or update the existing ones.  
In this use case, a submission of a form that contains three fields (name, surname and email address) launches a workflow that creates a customer profile or updates an existing profile with identical credentials.


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

Completing this procedure requires some knowledge on sending API requests using cURL, Postman, or similar tools.

</div></div></div>
  

<figure>
<img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/use-cases/all-cases/_gfx/ms-forms-marketing-img.png" alt="Workflow that sends data from forms to Synerise" class="full no-frame">
</figure> 

## Prerequisites 
---
Access to Microsoft Forms and Microsoft Azure.

## Process
---
In this use case, you will go through the following steps:
1. [Create an incoming webhook](/use-cases/send-data-from-forms#create-an-incoming-webhook).
2. [Create a form](/use-cases/send-data-from-forms#create-a-form).
3. [Create a workflow](/use-cases/send-data-from-forms#create-a-workflow).

## Create an incoming webhook
---
Create an incoming webhook to which you will send the data submitted through Microsoft Forms.

1. In Synerise, go to **Automation Hub > Incoming > New integration**.
2. Enter the name of the webhook.
3. In the **Endpoint** section, click **Define**.  
        
   <div class="admonition admonition-important"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

   The URL field is already is filled in with the endpoint to which the data submitted throught the form will be sent.

   </div></div></div>
 
    1. Optionally, you can add an icon to this integration.
    3. Confirm by clicking **Apply**.  
        <figure>
        <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/use-cases/all-cases/_gfx/incoming-webhook-forms.png" alt="Configuration of the Endpoint section" class="full">
        <figcaption>Configuration of the Endpoint section</figcaption>
        </figure>
4. In the **Incoming data** section, click **Define**.
5. Click **Retrieve data**. Right after you click the button, send a request to the endpoint in the **Endpoint** section with the sample of data that will be sent through forms. The system waits for the incoming request for 1 minute and 30 seconds. Example request:  

    
   <div class="admonition admonition-important"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

   Replace the endpoint URL from the example with the endpoint URL from step 3.

   </div></div></div>


    
   <pre><code class="language-plaintext">curl --location --request POST 'https://{SYNERISE_API_BASE_PATH}/automation-endpoint/endpoints/END_ID/trigger' \
   --header 'Content-Type: application/json' \
   --data-raw '{
    "firstname": "test",
    "lastname": "test",
    "email": "test"
   }'</code></pre>


6. When the endpoint receives data from the request, verify the list of variables. If the variables include those which are in the payload (in this case, firstname, lastname, and email), click **Define**. If not, click **Start again** re-send request, and wait for the results.
    <figure>
    <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/use-cases/all-cases/_gfx/incoming-data-forms.png" alt="Collected variables from the request" class="full">
    <figcaption>Collected variables from the request</figcaption>
    </figure>
7. Click **Save & publish**.  
    
   <div class="admonition admonition-tip"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z" /></svg></div><div class="admonition-body"><div class="admonition-content">

   You can read the documentation of Incoming integration [here](/docs/automation/integration/incoming-webhook-node).

   </div></div></div>


## Create a form
---
In this part of the process, you need to create a form in Microsoft Forms app and configure the flow of sending data from the form to Synerise.

1. Go to Microsoft Forms app.
2. Create a form.  
    
   <div class="admonition admonition-tip"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z" /></svg></div><div class="admonition-body"><div class="admonition-content">

   If you need help, you can refer to the [documentation](https://support.microsoft.com/en-us/office/create-a-form-with-microsoft-forms-4ffb64cc-7d5d-402f-b82e-b1d49418fd9d).

   </div></div></div>


    <figure>
    <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/use-cases/all-cases/_gfx/test-form-microsoft.png" alt="Example form used in this use case" class="large">
    <figcaption>Example form used in this use case</figcaption>
    </figure>
3. Go to Azure Portal. From the list of Azure services, select Logic Apps. If you don't see the icon right away, click **More services** and find the app.  
    <figure>
    <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/use-cases/all-cases/_gfx/azure-services.png" alt="Azure services available in the Azure Portal" class="full">
    <figcaption>Azure services available in the Azure Portal</figcaption>
    </figure>
4. As the connector of the Logic App, select Microsoft Forms.  
    <figure>
    <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/use-cases/all-cases/_gfx/azure-logic-apps.png" alt="Example form used in this use case" class="large">
    <figcaption>Connecting Logic App with Microsoft Forms</figcaption>
    </figure>
4. As a trigger, from the dropdown list, select **when a new response is submitted**. 
5. Choose the form you want to connect.
    <figure>
    <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/use-cases/all-cases/_gfx/azure-logic-apps2.png" alt="Selecting a form" class="large">
    <figcaption>Selecting a form</figcaption>
    </figure>
6. In the panel of operations, choose **Microsoft Form Standard**. As an action, choose **get response details**.
7. From the **Form Id** dropdown list, select the ID of your form. 
8. From the **Response Id** dropdown list, As response Id select **List of response notifications Response Id**.  
    <figure>
    <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/use-cases/all-cases/_gfx/azure-logic-apps3.png" alt="Selecting an action to be performed when a form is submitted" class="large">
    <figcaption>Selecting an action to be performed when a form is submitted</figcaption>
    </figure>
9. In the panel of operations, choose **HTTP**. Configure this section according to the [incoming webhook](/use-cases/send-data-from-forms#create-an-incoming-webhook) you created before. The body must be identical to the body you defined in the incoming webhook in Synerise.
    <figure>
    <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/use-cases/all-cases/_gfx/azure-logic-apps4.png" alt="Configuring the endpoint section" class="large">
    <figcaption>Configuring the endpoint section</figcaption>
    </figure>
10. Save the workflow. 

## Create a workflow
---
In this part of the process, you create a workflow in Synerise. The workflow starts with the business event trigger that is launched every time a customer submits the form. In response to that, a customer profile is created or updated if it exists already.  

1. In Synerise, go to **Automation Hub > Workflows > New workflow**.
2. Enter the name of the workflow.
3. As the first node, select **Business Event**. In the configuration of the node:  
    1. Select the incoming webhook you created as the first part of this use case.
    2. Confirm by clicking **Apply**.  
        <figure>
        <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/use-cases/all-cases/_gfx/business-event-forms.png" alt="Configuring the Business Event node" class="full">
        <figcaption>Configuring the Business Event node</figcaption>
        </figure>
4. Add the **Outgoing Integration** node to the workflow. In the configuration of the node:  
    1. Enter the name of the webhook. This name will be used as a value of the `name` parameter of the `webhook.response` event.
    2. Select the **POST** method.
    3. Enter the endpoint URL: 
        - For workspaces hosted in Microsoft Azure EU: `https://api.synerise.com/v4/clients/batch`
        - For workspaces hosted in Microsoft Azure USA: `https://api.azu.synerise.com/v4/clients/batch`
        - For workspaces hosted in Google Cloud Platform: `https://api.geb.synerise.com/v4/clients/batch`
    4. Enter the following headers:  
        - set the `content-type` header to `application/json` (default),
        - set the `accept` header to `application/json`,
        - set the `api-version` header to `4.4`
    5. Enter the request body. For the form used in this case, the body is as follows:  
        
       <pre><code class="language-json">{
           "email": "{{ request.body.email }}",
           "firstname": "{{ request.body.firstname }}",
           "lastname": "{{ request.body.lastname }}"
       }</code></pre>

    5. In the **Authorization** section, select **By API key**.  
    6. From the dropdown list, select API key that has permissions to create or update customer's data.  
    
   <div class="admonition admonition-tip"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z" /></svg></div><div class="admonition-body"><div class="admonition-content">

   You can read more about API keys [here](/docs/settings/tool/api) and you can find more information about the endpoint and required API key permissions [here](https://developers.synerise.com/ClientManagement/ClientManagement.html#operation/BatchAddOrUpdateClients).

   </div></div></div>

6. Confirm by clicking **Apply**.  
    <figure>
    <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/use-cases/all-cases/_gfx/outgoing-integration-forms.png" alt="Configuring the Outgoing Integration node" class="large">
    <figcaption>Configuring the Outgoing Integration node</figcaption>
    </figure>
7. Add the **End** node.
8. Activate your workflow by clicking **Save & Run**.  
    
<figure>
    <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/use-cases/all-cases/_gfx/msc-form-workflow.png" alt="Final workflow configuration" class="large">
    <figcaption>Final workflow configuration</figcaption>
    </figure>

## Testing
---
If the workflow works, you will see a new/updated customer in **Behavioral Data Hub > Profiles** and a success in the statistics of the **Outgoing Integration** node:

<figure>
<img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/use-cases/all-cases/_gfx/workflow-stats-forms.png" alt="Workflow statistics" class="full">
<figcaption>Workflow statistics</figcaption>
</figure>  

## Watch video
---
You can watch the video that presents the whole process of implementing this use case.



## Check the use case set up on the Synerise Demo workspace
---
In the Synerise Demo workspace, you can check the configuration of: 
- the [incoming integration](https://app.synerise.com/automations/custom-blocks/integrations/incoming/edit/a205358b-d82b-4e35-88a3-b511d8e3a04d)
- the [workflow](https://app.synerise.com/automations/automation-diagram/f3c9163c-a6e8-4276-a11c-6e45ce1f181f) 

If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace.  

If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. 

## Read more
---

- [Automation Hub](/docs/automation)
- [Integrations](/docs/automation/integration)
