# Use Case: Adding Users through Make (formerly Integromat)

In this use case, we are going to use the API to add users to a Softr app via Make. We are going to add users on Airtable and send them to Softr. Let's proceed.

{% hint style="info" %}
Please, check out [this guide](https://softr.gitbook.io/softr-documentation/my-account/api-settings/use-case-adding-users-through-make-formerly-integromat/use-case-adding-users-through-integromat) if you're using **Integromat**.
{% endhint %}

### Step 1: Setting a Trigger

First of all, we're going to create a table on Airtable with **Name**, **Email**, **Password**, **Magic Link, Created Date/Time** (needed for watching record creation in Make) columns to store user data.

![Table setup on Airtable](https://3426011356-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0NiyhsmXAcV5u1c6XK%2Fuploads%2F5XWelWliG8Ou9uVFVf6f%2Fairtable-columns-b.png?alt=media\&token=bfd6c2c8-20eb-41a1-8c54-ebb1ed8dd693)

Then, we'll go to Make dashboard, create a new scenario, and add a trigger that watches for new records on our selected table. See below.

![Creating the trigger](https://3426011356-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0NiyhsmXAcV5u1c6XK%2Fuploads%2FneEeZF6ryqK9h0PxTXci%2FScreen%20Recording%202022-04-11%20at%2009.42.41.gif?alt=media\&token=fc9e4d8a-d03a-4ffc-aa2c-770f131fdaa9)

Now, we need to set up an **Action** to add the users received from Airtable. There are two options for this:&#x20;

* **Make's Softr module;**
* **Custom HTTPrequest.**

Let's consider each option separately.

## Option 1: Make's Softr module

### Step 2: Configuring the Action

Let's add a new module to the scenario, search for "Softr," and select it.

![Locating the Softr module](https://3426011356-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0NiyhsmXAcV5u1c6XK%2Fuploads%2FJrHdtHgA6377NrbucCNt%2Fsoftr-app-b.png?alt=media\&token=603ed18b-312d-493d-a125-dbbdaaac61d2)

Then, we are going to choose the **Create a User** option.

![Choosing the Action](https://3426011356-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0NiyhsmXAcV5u1c6XK%2Fuploads%2FG9m6IMzdKlt1JST7lnIz%2Fcreate-user-b.png?alt=media\&token=9c3a13ee-4bae-49b0-9665-d5320db46726)

Next, we need to establish a connection with our Softr account and app, inputing the [Softr API key](https://softr.gitbook.io/softr-documentation/my-account/api-settings/..#generating-an-api-key) and the domain of the app we want to add users to.

![Adding a Softr connection](https://3426011356-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0NiyhsmXAcV5u1c6XK%2Fuploads%2F2pWYsAJZ87dmChCI2dTh%2Fapi-connection-b.png?alt=media\&token=c30b4a52-31ec-4eed-bd00-d2ff83093b9e)

Lastly, we need to map the user fields from our table as shown below.

![Mapping the user fields](https://3426011356-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0NiyhsmXAcV5u1c6XK%2Fuploads%2Fj6cbqNHj6jXkOvVBSiCt%2Ffield-mapping-b.png?alt=media\&token=9ec20d92-2ef7-49a4-8966-ce39e95ea5d6)

{% hint style="success" %}
As you can see, we haven't mapped the **Magiclink** field from the table but have just set the value to **Yes** to generate one automatically. We can sync it back to Airtable if we [connect our table](https://softr.gitbook.io/softr-documentation/memberships/users-tab/users/connect-to-airtable) to Softr, which we'll discuss in **Step 3**.
{% endhint %}

That's it. Now, we just need to save the module and the scenario is ready. Let's test it to make sure everything is working correctly.

### Step 3: Testing the Scenario

Let's add a new user to our table and check if it's sent to our Softr app successfully.&#x20;

{% hint style="info" %}
This is optional, but we are also going to [connect our Softr users base](https://softr.gitbook.io/softr-documentation/memberships/users-tab/users/connect-to-airtable) to the same Airtable base and table at the beginning to sync user data **from** **Softr to Airtable** as well. This way, the magic link that's been generated when fetching the user **from Airtable to Softr** will be stored in Softr and eventually **synced back to Airtable**.
{% endhint %}

![Testing the scenario](https://3426011356-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0NiyhsmXAcV5u1c6XK%2Fuploads%2F1nXeLDEs9tIAcKLWUaP1%2FScreen%20Recording%202022-04-11%20at%2010.11.53.gif?alt=media\&token=12877211-f5eb-4ca4-9e93-b4dff33affc4)

## Option 2: Using a Custom HTTP Request

### Step 2: Configuring the Action

In this case, we need to create a new module, search for **HTTP**, select it, and choose the **Make a request** action.

![Selecting the Action](https://3426011356-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0NiyhsmXAcV5u1c6XK%2Fuploads%2FlJmxa3AiDihz2Qzw3upJ%2Fmake-request-b.png?alt=media\&token=cf4f1df3-f937-4b3e-8430-9ff2af65d5c2)

Now, let's start configuring the module based on our [endpoint](https://softr.gitbook.io/softr-documentation/my-account/api-settings/..#create-user). First we need to add our **URL**, then select the **method** (POST), and finally add the required **headers**. We don't need to add the **Content-Type** header, as it's going to be added in the next step. Below, you can see what it should look like.

![Configuring URL, Method, and Headers](https://3426011356-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0NiyhsmXAcV5u1c6XK%2Fuploads%2FfLj04vylpEsH1cOTavHg%2Fhttp-first-b.png?alt=media\&token=1141ac85-d8bb-4622-9172-d0a8751c25c6)

Further on, we need to set the **Body Type** to **Raw** and the **Content Type to JSON**. Lastly, we are going to fill in the **Request Content** using the format provided [above](https://softr.gitbook.io/softr-documentation/my-account/api-settings/..#create-user). Please, note that the **Parse response** option should be set to **Yes**.

![Configuring Body and Content types and adding Request content](https://3426011356-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0NiyhsmXAcV5u1c6XK%2Fuploads%2FPJEDMdXPy8XxjcE0pfKI%2Fhttp-second-b.png?alt=media\&token=910e7524-f48a-49c6-93a5-476c573ee78f)

### Step 3: Testing the Scenario

So, we're almost there. Let's just add a new record in our table and run the scenario to test it. As, you can see below, the user is successfully added to our Softr app.

{% hint style="info" %}
This is optional, but we are also going to [connect our Softr users base](https://softr.gitbook.io/softr-documentation/memberships/users-tab/users/connect-to-airtable) to the same Airtable base and table at the beginning to sync user data **from** **Softr to Airtable** as well. This way, the magic link that's been generated when fetching the user **from Airtable to Softr** will be stored in Softr and eventually **synced back to Airtable**.
{% endhint %}

![Testing the Scenario](https://3426011356-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0NiyhsmXAcV5u1c6XK%2Fuploads%2FrKMpecc3aASz1sJqTMgA%2FScreen%20Recording%202022-04-11%20at%2010.47.59.gif?alt=media\&token=af4825ad-25f8-4f6d-bac7-43f15a7efde6)

## Deleting a User

The [delete request](https://softr.gitbook.io/softr-documentation/my-account/api-settings/..#delete-user) can be implemented in a similar way through an HTTP (Make a request) module.&#x20;
