Ask AI

Syncing users with a data source

Sync your user database with a data source.

You can manage your users entirely in Softr or sync users with an external data source. By connecting to a data source, you get to use additional custom fields to create User Groups and application logic (e.g. Conditional Filters).

2-way sync availability per source

 
Source
Availability
Airtable
Google Sheets
SmartSuite
SQL
Monday
HubSpot
Notion
Supabase
Xano
BigQuery
N/A
REST API
N/A

Setup

Making the Connection

Click on the Users menu panel, then click on the Sync with data source button to start the setup.

Notion image
 

Next, you need to select the data source you want to map to. Softr offers a variety of datasources to pull User’s from, and each one has its own connection methods. Learn more about data source connections here.

If you already have a data source connected, you can choose it from the list, otherwise you’ll be prompted to create a new connection to your selected data source. In the example below, we’re selecting Airtable as the data source.

Notion image

Airtable requires us to select the Base and Table we want to use for the Users of our app, but some datasources ask for other criteria such as “Solution”, “Workspace”, “Table”, or “Sheet”.

Notion image

Filtered User Sync

Softr let’s you choose who should be counted as a user. The Records section allows you to sync All users from the data source, or you can choose Selected to setup rules for who should be synced as a User of your app.

This is extremely helpful for when you may have lots of contacts, but only certain ones need access to the app. For instance, app subscribers, internal team members, or contacts who have an approved status.

You can optionally toggle the ability to create a new User in the data source if one is added from the Softr side. We recommend leaving this checked.

Notion image

Mapping User Fields

Now that the source is selected, we need to map the fields that will be tied to the Users of our app. Only only field is required to generate a User. Other optional fields are available to add in the dropdown. Any fields not listed here will still be available for use in your app, but only these are necessary for Softr’s User management.

Notion image
  • Email * — this is the unique user identifier and how we are able to connect user records. Please do not edit email on the data source side.
  • Name (optional)
  • Avatar (optional) — instructions on setting up avatar can be found here
  • Created date (optional) the date when the user was created
  • Last seen date (optional) — the date when the user last used the application.

Authentication Method

Lastly, you’ll want to choose the method by which your users should be able to login with for the first time. You can either send them a Magic Link, which will automatically log them in, or you can send them a temporary password and let them reset their password later.

Using these methods is optional, but especially helps in onboarding new users for the first time. Which one you choose will determine which Email Template is sent when Inviting new users to your app.

Once finished, click on the Save and sync button in the lower right corner of the popup modal.

Notion image

Softr will begin syncing users from your data source into your app and you will begin to see users populating in your Users menu.

Notion image

How does 2-way syncing work?

💡
Below logic is based on 2-way sync. If you have applications created before June 2023, you’ll have to manually enable 2-way sync on each of them.
  • Adding user: Any user created via Softr will get added to your connected source, and vice versa.
  • Deleting user: Any user deleted via Softr will also get deleted from the source. However, deleting a user from source will not delete user in Softr, and the user will be added back in the next sync (we do this to prevent unrecoverable mistakes).
  • Changing user data: Fields such as Last seen date and Magic link only make sense to be managed via Softr. If you edit the value from the source, it will be overridden on the next sync.
🙅‍♂️
Please DO NOT edit a user’s Email from the source. Softr will not be able to identify that user.

When does syncing happen?

If your app’s user table syncs with a datasource, any new user added to your source table will get synced to Softr immediately. User syncing is not continuous inside of Studio or on unpublished apps. Only when you publish your app will user sync be realtime and continuous. You can also pause auto-sync at anytime in the connection settings:

Notion image
 

We’ve also defined many syncing triggers inside of Softr Studio to ensure your app always gets the latest user data when it actually needs it. A few examples:

  • When a user logs into an app.
  • When you publish new app changes.
  • When you visit the Users tab.

If you run into any cases where the data isn’t getting synced, and it’s affecting how your app works, please let us know!

Syncing issues

If there’s an issue with syncing with a data source (e.g. you have a duplicate user in your data source), you’ll be notified about that as shown below.

Sync issue notification
Sync issue notification

Click on See details to learn more and address the issues. After successfully fixing the issue, hit Validate fix to trigger a sync.

Notion image

Enabling 2-way sync on older apps

User syncing between Softr and data source used to be 1-way (from application to data source only). If you have an app created before the introduction of 2-way sync in June, 2023, you’ll have to manually enable 2-way sync by going to the Users tab.

Enabling 2-way sync
Enabling 2-way sync
Did this answer your question?
😞
😐
🤩

Last updated on December 19, 2024