# Use Case: Adding Users through Integromat

In this use case, we are going to use the API to add users to a Softr app via Integromat. We are going to add users on Google Sheets and send them to Softr (this is solely for demonstration purposes, and we don't recommend storing user data on Google Sheets or similar sources). Let's proceed.

### Step 1: Setting a Trigger

First of all, we're going to create a spreadsheets with Name, Email, and Password columns to store user data.

![Users sheet](https://3426011356-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M0NiyhsmXAcV5u1c6XK%2F-MhYgbxsfhBgkAScSrX6%2F-MhYmSdv1FsQjMRPEbQ_%2Fsheet-b.png?alt=media\&token=aa70b190-e486-41de-a5ce-ec5ef5d8be14)

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

![Creating the trigger](https://3426011356-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M0NiyhsmXAcV5u1c6XK%2F-MhYaOpc2G1zmzwYNeO6%2F-MhYcQUBiqkMAIjg911A%2Fsetting%20trigger.gif?alt=media\&token=e662ecc8-93af-4baa-807f-08af81f40257)

Note that we're also setting the **Row with headers** according to our sheet (**A1:C1**).&#x20;

Now we need to set up an Action to add the users received from Google Sheets. There are two options for this: Custom HTTP request and Integromat's Softr module. Let's consider each option separately

## Option 1: 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-legacy-files/o/assets%2F-M0NiyhsmXAcV5u1c6XK%2F-MhYcn1wWrg2mFMfMzBl%2F-MhYdSd-uKfkcF12nVe_%2Fmake-request-b.png?alt=media\&token=ed2d7c06-61f0-41ea-8634-fc5ed8e26f95)

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. You can see how it looks like below.

![Configuring URL, Method, and Headers](https://3426011356-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M0NiyhsmXAcV5u1c6XK%2F-MhYmabSAdmkCsKZVHPA%2F-MhYn0l7ZjvP6ErC6m-s%2Furl-b.png?alt=media\&token=fec00f3a-b04a-476f-ac2b-a213f5872617)

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 checked.

![Configuring Body and Content types and adding Request content](https://3426011356-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M0NiyhsmXAcV5u1c6XK%2F-MhYd_axJWLerTK0JpnW%2F-MhYfNlwM83Bj0urpfSF%2Faction-config-2-b.png?alt=media\&token=c26a7602-3133-4059-931c-73da79ea0e21)

### Step 3: Testing the Scenario

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

![Testing the Scenario](https://3426011356-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M0NiyhsmXAcV5u1c6XK%2F-MhYmabSAdmkCsKZVHPA%2F-MhYo2SL_UM7Y2Vy2dOC%2Fscenario-test.gif?alt=media\&token=213a54c7-dcd0-46c7-bd00-3365cd0ec3da)

## Option 2: Using Integromat'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%2FUEFg5ee9jEm0tZt6TjFH%2Fselecting-softr-module-b.png?alt=media\&token=2a3e630f-dae9-493e-bc85-4cc8a0f7e50d)

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

![Choosing the action](https://3426011356-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0NiyhsmXAcV5u1c6XK%2Fuploads%2FvoFlj2MtMU6gGNujk5w4%2Fintegromat-create-user-b.png?alt=media\&token=73c80f79-a5b9-410d-83dd-e442b60594bf)

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%2FMCYZbyYKMazmdwVuOAUi%2Fintegromat-softr-connection-b.png?alt=media\&token=0f656320-12cb-4b72-9ae8-1a7a9a66e494)

Lastly, we need to map the user fields from our spreadsheet 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%2FNd50jTDOeJCGWWuRlxIG%2Fintegromat-mapping-fields-b.png?alt=media\&token=c6700616-fa08-4c84-b1a2-c45dc09c153a)

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 spreadsheet and check if it's sent to our Softr app.

![Testing the scenario](https://3426011356-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0NiyhsmXAcV5u1c6XK%2Fuploads%2FQPM9aVEXyOo204jJ3H9g%2FScreen%20Recording%202021-12-17%20at%2018.06.43.gif?alt=media\&token=a40d7222-cdbb-4783-b91c-8c1f7a88f3bf)

## 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;
