GoodBarber + Zapier: automatically add a user to a group

As a reminder, we have developed 2 integrations with Zapier:
- GoodBarber: this integration offers actions and triggers for content apps
- GoodBarber eCommerce : this integration offers actions and triggers for eCommerce apps.
In this article, I'll give an example of how to use the integration for content apps. I refer you to this article by Marie, which explains how Zapier works in general, and this one , which contains an example for eCommerce apps.
Let's take the case of an app that uses the authentication and user group extensions. I've created 2 groups in this app. My aim is to automatically assign each new user who registers to one of the 2 groups.

Before we start, we need to add the Zapier extension to the app and create an API key to connect the app to Zapier. This prerequisite is well explained in this online help .
Next, I add a "Find a User in GoodBarber" search action. This allows me to find out the group chosen by the user when registering. The search criterion expected by this action is the user's email. The user's email is given to me in the previous step. I just need to use it in this step.

- name = the name I've given to the custom field I've added to the app's registration process, in this case, "Preferred group".
- value = the choice made by the user at the time of registration among the 2 choices proposed. The value 0 corresponds to the first answer (choice 1), and the value 1 to the second answer (choice 2).
To do this, I now add an action that will divide the path of my zap into 2. This is the "Paths" action. It's a default action in Zapier.
The zap continues with Path A if value = 0
The zap continues on Path B if value = 1

"Only continue if Custom Field Value exactly matches 0".
Custom Field Value is the value of the "Preferred Group" custom field obtained in step 2 of the zap.

- Group A ID. There are several ways of obtaining this ID. You can use the "Find a group" action in Zapier, or the "List all user groups" method in GoodBarber's public AP I. I followed the second option, using Postman to retrieve the results returned by the API. I'll explain how to do this in a future article.
- User ID. This information is available in the results of step 2 of my zap. I'll simply reuse it here.
- by changing the path-following rule. We need the value of the custom field to be equal to 1
- with Group ID B instead of Group ID A.
Now, when a user registers in my app, they're automatically moved to the right user group.
Design

