Introduction
If users have questions or encounter problems, the helper sometimes can understand the user better when he can see exactly the same as the user. You can achieve this by taking over the account of the user.
The prerequisites are that your application contains the Data items User and Person (check the article about splitting users and persons for an explanation).
What will happen:
-
In order to recreate the situation when the helper is finished, the Persons who are the owner of the accounts must be saved in the Data item User.
-
After that, the application links the Person that will be taken (the Helped person) over to the user-account of the helper.
-
This means that while the Person is taken over, he can remain signed in or sign in during the operation, but he can’t see his person-related data.
-
The helper remains signed in with his own account, so he has his own Roles, but he can’t see his personal data.
-
The helper can see the data of the Helped person and he can act as if he were him.
-
Afterwards, the original relations between the user accounts and Persons that ‘own’ them are restored.
Step 1: split users and Persons
If you haven’t done this yet, refer to the article “Splitting users and persons” in our Knowledge base.
Step 2: modify Data item User
Add the True or False Property May take over persons.
Note: you might already have the Property Is admin. Don’t use this: the Persons who will be allowed to take over a client might not all be admins.
Step 3: create the Flow part to take over a Person
-
Add 2 Inputs: the Helping user and the Helped user.
-
When you have finished helping, you want to restore the situation. Therefore you must save the owner of the helped account in Person that owns the account.
-
Do the same for the Helping user.
-
Now the original owners of the accounts are safely stored, you can link the Helping user account to the owner of the Helped user account.
-
To prevent disputes later, it is a good idea to add the action to a log.
Step 4: create the Flow part to restore the situation
-
Add 1 Input: the Helping user.
-
Check if the Account owner of the Helping user is Empty. If so: the Helping person is not taking over a Person. End the flow.
-
If there is a value in Owner, find the user account of the Helped person (the person that owns the account of the Helped user = the Person in the account of the Helping user).
-
Copy the Owner of the helped account to Person of the helped account. Now the Helped user and his account are linked again.
-
Clear the Owner of the helped account. This is the signal that the user is not being helped.
-
Copy the Owner of the helping account to Person of the helping account. Now the Helping user and his account are linked again.
-
Clear the Owner of the helping account. This is the signal that the user is not helping.
-
To prevent disputes later, it is a good idea to add the action to a log.
Step 5: modify User flows
Modify the User flow Persons:
-
In the User flow where you manage the Persons, include a Button that is only visible when the Property May take over persons in User is True.
-
This Button calls the Flow part Take over a person, followed by a Page on which you tell the user what just happened.
-
Add the Button Got it that connects to the User flow My profile or another one that the person normally opens.
-
Insert the Flow part When needed split helper and helped person right after the start of the User flow. This will restore the situation.
Sometimes helpers forget to restore the Take-over situation by returning to Persons. This can lead to unwanted situations.
Therefore, it is advised to include the splitting Flow part at least in the first User flow the user will see when they log in. This way, the application checks if there is a helping situation going on and it can end it when the helper has left the User flows of the Helped person.
How to check for irregularities
It can happen that a take over is not flawlessly restored. This leads to the situation that a user can’t reach his data. We advise you to store a copy of the User email in the Data item Person. This makes it easier to find the ‘lost’ user account of the person.
Once you have done that, you can search for Persons whose email address differs from the linked user account, or active users who are not linked to a person.
You can perform these searches manually, for instance by including it in your User management flow.
Tip: By following these steps you’ll soon be an application building guru!