# Splitting users and persons

**URL:** <https://community.triggre.com/t/splitting-users-and-persons/747>\
**Category:** Data\
**Tags:** data, designer\
**Created:** [December 31, 2019, 11:00pm UTC](https://community.triggre.com/t/splitting-users-and-persons/747 "2019-12-31T23:00:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mar](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.triggre.com/mar/32/395_2.png) [@Mar](https://community.triggre.com/u/Mar)\
**Post date:** [December 31, 2019, 11:00pm UTC](https://community.triggre.com/t/splitting-users-and-persons/747/1 "2019-12-31T23:00:00Z")

</div>

## Introduction

Typically we use the **Data item** _User_ for storing **Properties** of our users. This is convenient: all user-properties are in the same place.

But there are some disadvantages to this setup:

1. Maybe not all persons using the application need a user account. Think of one-time-only webshop customers or contact persons of a CRM system.

2. You cannot “take over“ a user account to see what the user sees (because you need the login credentials of the customer or employee for that). This can make it difficult to help users without sharing a screen.

3. Changing the email address of a user is complicated: first create a new user. Then all data and **References** of the old user must be copied to the new one and the old user must be blocked. Then the data and **References** of the old user must be cleared.

The solution is to create a **Data item** _Person_ that will be linked to the user. Now:

1. The person only gets a user account when he needs to be able to login.

2. A supporting user can take over the account of the person he is helping. This way he can see and do exactly what this person can see and do.

3. The person can change his email address easily: create a new user, link the person to the new user and block the old user. The person gets a new activation mail and from then on he can use his new email to sign in.

## Step 1: create the Data item _Person_

1. Save the current version.

2. Create **Data item** _Person_.

3. Add a 1-1 **Reference** to _User_. Name it _My account_, in data item _User_, name it _Person that owns the account_. When a person is taken/taking over, the owner of the account is stored here temporarily.

4. Add another 1-1 **Reference** to _User_. Name it _User_, in data item User, name it _Person_. This reflects the link that normally exists between the user and the person.

5. Add the **Properties** that you will remove from the **Data item** _User_.

6. Create a **User flow** for _Person_ and include it in **Appearance**.

> Tip: Don’t adjust the related flows yet: after you delete **Properties** from the **Data item** _User_ (see below), Triggre will show you where you have work to do.

## Step 2: transfer the data from _User_ to _Person_

There are two options, depending on how much data you have to transfer.

### Option 1

Build a **Flow part** to copy the data from _User_ to _Person_. This option is our favorite, because all data stays within the application and it saves a lot of hassle.

1. Create a **Flow part** with a **Repeat action** that copies the data in **Data item** _User_ to the related person. You can find an example of such a **Flow part** below.

2. Modify the _Admin_ **User flow** : add a **Button** that triggers this **Flow part**.

3. Save the current design. In case you need to revert to it.

4. Publish the design.

5. Activate the **Flow part.**

6. Check the data in **User flow** _Persons_.

### Option 2

Export the data from _User_ and import them in _Person_. This is the option we don’t advise you to use, because you might end up with a lot of manual actions.

1. Be sure that you allow import in _Person_.

2. Be sure that you have a **User flow** available from which you can export all user-data that you want to import in _Person_.

3. Save the current design. You might need to revert to it.

4. Publish the design.

5. Export the user-data.

6. Adjust the Excel to the design of _Person_ (don’t forget to rename Email to Email [ID] and to rename the sheet to _Person_).

7. Import the sheet into _Person_.

## Step 3: delete the transferred Properties from the data item _User_

1. Save the current version. You are about to remove **Properties** from the **Data item** _User_. You definitely want to be able to undo these changes if you find out you did something wrong.
2. Remove the **Properties** in _User_ that you added to _Person_. This will probably result in broken items in **Flow parts** and **User flows**.

## Step 4: correct the ‘red’ design items

Check the designer for red dots.

 ![Designer red dots](https://canada1.discourse-cdn.com/flex035/uploads/triggre/original/1X/227f2cfbab48989b32c5f066d3bfb3a026413df8.png)

Correct the items with red dots.

 ![Identify red dots](https://canada1.discourse-cdn.com/flex035/uploads/triggre/original/1X/404ac001ae58625f8a468e8da12b05a9dde5fae9.png)

An example: you transferred _First name_ from _User_ to _Person_. Now the **Flow part** that generates the full name lacks some data.

 ![Flow part error](https://canada1.discourse-cdn.com/flex035/uploads/triggre/original/1X/461b1a6933870097a61f484201e1d96e5a217aec.png)

Before:  
 ![Input error](https://canada1.discourse-cdn.com/flex035/uploads/triggre/original/1X/72840937d0c88d341324be8b05fef5ab5066a719.png)

After:  
 ![Input error fixed](https://canada1.discourse-cdn.com/flex035/uploads/triggre/original/1X/ae5820703eaf62076ca30dfcaac8f69f7082b180.png)

After making all the changes, save the current version and publish the design.

## Example of the transferring Flow part

### Create the **Flow part**

 ![Flow part creation](https://canada1.discourse-cdn.com/flex035/uploads/triggre/original/1X/d0c1c248fcc9de72c3bdae1aeae0e5b745fd549c.png)

1. Add a **Look-up** of all users.
2. Add a **Repeat action** , based on the **Look-up**.

### Design the **Repeat action**

 ![Repeat action overview](https://canada1.discourse-cdn.com/flex035/uploads/triggre/original/1X/8c81d55f6525c911d1154694b68d295087f8610c.png)

1. Create the related person.

2. Copy all **Properties** of the user to this person.

3. For every referenced **Property** , add a **Look-up list**. Example: invoices.  
 ![Look-up list](https://canada1.discourse-cdn.com/flex035/uploads/triggre/original/1X/c5af1db13ce68fa6c401433f527f1dcc5968a634.png)

4. Store the person in all these invoices:  

## Which email to use?

Since the email will be available in both _User_ and _Person_, you have to decide which one you will use in **User flows** and **Flow parts**. Both should be identical. We advise you to use Email in _Person_, because when you have persons in your system without a user account, only the Email in _Person_ is available.
