# Creating a CRM

> Building the structure of a CRM: fields, types, permissions and loading from a file

## A look at the module

An Audara CRM does not come with fields out of the box: you decide what it keeps about each person and each business, in what order it shows and who can touch it. That structure is built once, when you create the CRM, and afterwards every module that leans on it uses it: the bot that looks the customer up before greeting them, the dialer that pulls out who to call and the agent who sees the record while working.

Creation lives in **Setup > CRM**, which is a different screen from the **CRM** one in the side menu. The rule is easy to remember:

- **Setup > CRM**: The structure is built: the fields, the types, the permissions and the sections. That is what this article is about.
- **CRM, in the side menu**: The content is worked on: searching, filtering, opening a record, writing to somebody and exporting. That is in the CRM usage article.

There are three ways to fill a CRM, and it pays to choose from the start:

- **Create New**: You build the form field by field and the CRM is born empty. It is the way to go when the contacts are going to come in through the chat, through the bot or by hand.
- **Create from File**: You upload a CSV and Audara proposes the fields from the columns of the file. It is the way to go when you already have the base in a spreadsheet.
- **Import**: You feed a CSV into a CRM that already exists, to add records or update the ones already there. It does not change the structure, only the content.

## The CRM list

The first screen is the list of the CRMs of the account, one per row.

![The CRM list in Setup](https://docs.audara.io/creacion-crm/imagenes/creacion-crm-lista.jpg)

- **Contacts and Businesses**: How many records each CRM has of each kind. A CRM you just created shows 0 on both.
- **Assignations**: How many modules that CRM is connected to. If the number is not zero, you can press it.
- **Updated**: The last time somebody changed the structure, not the content. Loading contacts does not move this date.
- **Status**: **Active**, **Inactive** or **Importing**. The last one is temporary: while it lasts, the CRM cannot be edited or deleted.

The search box at the top filters by name, and the **+** button in the header opens the two ways of creating one.

![The + button offers the two ways of creating](https://docs.audara.io/creacion-crm/imagenes/creacion-crm-nuevo-menu.jpg)

*The + button offers the two ways of creating*

### The assignations

The number in the **Assignations** column opens the list of who is using that CRM.

![The assignations of a CRM: two dialers, here](https://docs.audara.io/creacion-crm/imagenes/creacion-crm-asignaciones.jpg)

*The assignations of a CRM: two dialers, here*

The **[inbound campaigns](https://docs.audara.io/en/colas-inbound/)**, the **[dialers](https://docs.audara.io/en/marcadores/)** and the **chat groups** that have that CRM connected show up. It is the window to look at before touching the structure of a CRM that has been in production for a while, because every name on that list is a place where the change is going to be felt.

### The menu of each row

![The actions menu of a CRM](https://docs.audara.io/creacion-crm/imagenes/creacion-crm-menu.jpg)

*The actions menu of a CRM*

- **Edit**: Opens the same creation form, with the fields it already has. It is where new fields get added later.
- **Deactivate**: Leaves the CRM **Inactive**. It can still be looked at, but the modules that had it connected stop using it. It is the step before deleting when you are not sure.
- **Import**: Opens the wizard for loading a CSV into that CRM. It is further down in this article.
- **Delete**: Erases the CRM.

> **Important**
> Deleting a CRM **also erases all of its contacts and its businesses**, and the confirmation window does not say so. Audara only stops you if the CRM is **Importing** or if it is connected to a **campaign** or a **dialer**; a CRM connected only to a chat group is allowed to be erased with no warning. Before deleting, deactivate it for a few days and check the assignations column.

## Creating a CRM from scratch

**Create New** opens a single, long screen that is saved in one go with the **Save** button in the header. The button is off until the form meets the minimum, so if it does not turn on, the answer is in the validations.

![The creation screen, with the name and the two blocks folded](https://docs.audara.io/creacion-crm/imagenes/creacion-crm-formulario.jpg)

*The creation screen, with the name and the two blocks folded*

At the top goes the **name** of the CRM, which is the one it is going to appear under in the lists of the campaigns, the dialers and the bots. It cannot be repeated: if one with that name already exists, saving fails.

### Validations to keep in mind

![The two conditions every form has to meet](https://docs.audara.io/creacion-crm/imagenes/creacion-crm-validaciones.jpg)

*The two conditions every form has to meet*

The yellow block reminds you of the two conditions that hold up saving: that there is a **name** field and a field that works as a **key**, and that the empty cells of a file arrive genuinely empty or as 0, because any other filler is taken as wrong data.

### CRM Permissions

![The permissions, by role](https://docs.audara.io/creacion-crm/imagenes/creacion-crm-permisos.jpg)

*The permissions, by role*

This is where it is decided what **agents** and **supervisors** can do with this CRM. Each role has a main visibility switch and, below it, four separate permissions: **Create**, **Edit**, **Delete** and **Download**.

> **Note**
> The main switch is the **see** one: if it is off, the CRM does not appear to that role anywhere, even if a campaign of theirs has it connected. Admins do not show up here, because CRMs are assigned to them from their own user.

The two roles start off. A CRM that agents are going to work with needs, at the very least, that you turn on the visibility for agents.

## The fields of the form

Below the permissions is the form proper, split into two tabs: **Contacts** and **Businesses**. They are two independent forms that are saved together, and each one comes with its basic fields already in place.

- **Contacts**: Name, Last Name, Phone, Email and Business.
- **Businesses**: Name, Phone and Website.

The basic fields **cannot be deleted**, but their visible name and their actions can be changed. The rest you add yourself.

![Each field is a card: the type, the visible name and the actions](https://docs.audara.io/creacion-crm/imagenes/creacion-crm-campos.jpg)

*Each field is a card: the type, the visible name and the actions*

Each card has three parts. At the top, in grey, the **type** of the field, which is picked when it is created and does not change afterwards. In the middle, the **Field Name**, which is the label the agents are going to read and the header of the column in the lists. At the bottom, the **Field Actions**.

### The field actions

The switches of each card are read by their icon, from left to right:

- **Check: required field**: A record cannot be created or saved without filling it in.
- **Padlock: limited editing field**: Agents see the field but cannot modify it. It is there for the data that comes from the import or from the system of origin and that nobody should correct by hand.
- **Key: key field**: The field that identifies the record and cannot be repeated. It only appears on the types that can be one.
- **Eye: hidden field**: The field exists and stores data, but it is not shown on the record. It is for what gets filled in by integration and is of no use to the agent.
- **E.164**: Only on phone fields. It forces the number to be stored in international format, with a country code.
- **Pencil, on the right**: Opens the options of the field. It only appears on the types that carry them, and it is painted **red** while they are unassigned.

Three rules apply on their own and explain why a switch sometimes does not respond:

- **1.** Marking a field as the **key** makes it required straight away, and it can no longer be unmarked.
- **2.** **Required and hidden are mutually exclusive**: turning one on turns the other off. A field nobody sees cannot be demanded of anybody.
- **3.** **Name** and **Password** are always required and cannot be turned off.

The three-dot menu of each card has **Delete** and **Move to**, which passes the field to another section. Name, Last Name, Photo and Password cannot be moved.

## The field types

At the end of each section there is a type dropdown and a **+** button: you pick the type, press the plus and the card of the new field appears, ready to be named.

![The catalogue of types. The grey ones are already used](https://docs.audara.io/creacion-crm/imagenes/creacion-crm-tipos.jpg)

*The catalogue of types. The grey ones are already used*

The catalogue is the same for both tabs:

- **Name, Last Name**: The names of the person or of the business. **Only one of each fits** per form.
- **Phone**: A contact number. It is the one that carries the E.164 switch and the one the dialer and the campaigns use.
- **Email**: Validates that what is written has the shape of an email.
- **Business**: Only in Contacts. It is the field that hangs that person off a business from the Businesses tab. Only one fits.
- **Website**: Only in Businesses, and also only one.
- **Single Line Text and Multi-line Text**: Free text. The multi-line one is for notes and long addresses.
- **Numeric**: Numbers. With the pencil you pick whether it is **Integer**, **Decimal** or **Currency**.
- **Single Choice and Multi-choice**: Lists of fixed values. The first lets you pick one, the second several. The options are loaded with the pencil.
- **Date and Time**: A calendar and a clock.
- **URL**: A link.
- **File Upload**: Lets a file be attached to the contact record. Whatever is uploaded eats into the storage of the account.
- **Telegram**: The Telegram username of the person, so the channel recognises them.
- **Password**: It is not picked from the dropdown: Audara puts it there when you turn on the registration CRM.

> **Note**
> The types that come out **in grey** are already used in that form. They are the ones that admit only one: Name, Last Name, Business and Website.

### The options of a list field

![The options of a list field are written one by one](https://docs.audara.io/creacion-crm/imagenes/creacion-crm-opciones-lista.jpg)

*The options of a list field are written one by one*

You write each option and press Enter; it stays as a tag with its little x to take it out. **Upload from CSV** brings them in from a file: it reads the first column and, if a cell carries several separated by semicolons, it splits them. The cap is **2000 options** per field.

### The options of a numeric field

![A numeric of the Currency type also asks for the currency](https://docs.audara.io/creacion-crm/imagenes/creacion-crm-opciones-numero.jpg)

*A numeric of the Currency type also asks for the currency*

If you pick **Currency**, the list of currencies opens and the field is going to show with its symbol. **A currency field cannot be the key field**, and the other way round: if the field is already the key, the Currency option comes out blocked.

## The key field

Every form needs a **key field**: the piece of data that identifies the record and that cannot be repeated within the CRM. It is what Audara uses to know whether whoever is calling already exists, and what decides, in an import, whether a row creates a new contact or updates one that was already there.

Until you pick one, the red notice *All forms require a key field* stays above the form and the Save button does not turn on.

Only five types can be the key: **Phone**, **Email**, **Single Line Text**, **Numeric** and **Telegram**. On the rest, the key switch is not even painted.

> **In practice**
> The key that hurts least is an **ID document or an internal code** in a text field. The phone looks like the obvious option and it brings two problems: two people in the same house share a number, and the same person reaches you with their mobile written three different ways. If you are going to use the phone, turn on E.164 for it too so that at least the format is a single one.

In **Businesses** there is nothing to pick: the key is always the Name field and it cannot be moved.

![In Businesses the key comes set on Name and does not move](https://docs.audara.io/creacion-crm/imagenes/creacion-crm-negocios.jpg)

*In Businesses the key comes set on Name and does not move*

And the key **cannot be changed afterwards** if the CRM already has contacts loaded: the switch stays blocked. It is the decision most worth thinking about before saving.

## CRM registration

The **CRM registration** switch, which only appears on the Contacts tab, turns the CRM into a base of users who can authenticate. It is what gets used when the bot has to ask whoever writes in for a password before giving them information about their account.

Turning it on makes the screen do three things at once:

- **1.** It adds a **Password** field at the end, with a fixed name and impossible to delete.
- **2.** It sets **Email** as required and as the key field.
- **3.** It turns the key off on every other field and does not let it be moved.

![With CRM registration on, the email is left as the key](https://docs.audara.io/creacion-crm/imagenes/creacion-crm-registro-llave.jpg)

*With CRM registration on, the email is left as the key*

![And the Password field appears at the end](https://docs.audara.io/creacion-crm/imagenes/creacion-crm-registro.jpg)

*And the Password field appears at the end*

> **Important**
> This option **is decided when the CRM is created and cannot be changed afterwards**: when editing, the switch comes out blocked. If a CRM that is already in production is going to need authentication, a new one has to be created and the contacts migrated to it.

## Sections

The fields go inside sections, and every CRM starts with one, **Section 1: General**. The **Add Section** button at the end creates another, with its own name, and from the three-dot menu of a card you can move a field from one section to another.

![Moving a field to another section](https://docs.audara.io/creacion-crm/imagenes/creacion-crm-secciones.jpg)

*Moving a field to another section*

Sections are purely about organisation: the contact record shows them as separate blocks, with their title. On a CRM of eight fields they are not worth it; on one of thirty, they are the difference between a record that reads and one you have to walk through.

Inside a section the fields are dragged to order them.

> **Note**
> When you **create** the CRM, the order you dragged the fields into is not kept: they are saved grouped by type. Arrange them afterwards, going into **Edit**, because there the order is respected exactly as you left it.

## Creating a CRM from a file

The other option of the **+** button builds the CRM from a CSV: each column of the file becomes a field. There are three steps.

![Step 1: the name of the CRM and the file](https://docs.audara.io/creacion-crm/imagenes/creacion-crm-archivo-1.jpg)

*Step 1: the name of the CRM and the file*

You give the CRM a name and upload the file. The **Download Form Sample Template** link pulls down an example CSV with the shape Audara expects, and it is the fastest way not to have to guess.

> **Important**
> The file has to be **CSV separated by semicolons**, in **UTF-8** and under 500 MB. The screen only says "CSV format", but a file separated by commas is read as a single column. In Excel, *Save as > CSV* on a machine set up in Spanish already uses semicolons; if not, change it in the regional options or save it from Google Sheets and check the separator.

![Once the file is uploaded, it tells you how many records it carries](https://docs.audara.io/creacion-crm/imagenes/creacion-crm-archivo-cargado.jpg)

*Once the file is uploaded, it tells you how many records it carries*

![Step 2: what type of field each column is going to be](https://docs.audara.io/creacion-crm/imagenes/creacion-crm-archivo-2.jpg)

*Step 2: what type of field each column is going to be*

Step 2 is the important one. For each column of the file you pick the **field type** it is going to be, and you set its actions right there: required, padlock, key. The **Sample Record** column shows you the first real value from the file, which is the quickest way to notice that two columns ended up crossed.

- **All, Assigned and Not Assigned**: They filter the table. **Not Assigned**, in red, is the list of what is left to resolve.
- **The bin icon**: Discards that column: the field is not created and the data is not imported.
- **The asterisk**: Marks the types the form needs no matter what, like the Name.

You cannot go on while anything is left in **Not Assigned**: every column of the file has to end up with a type, or be erased with the bin. There are three other things that turn the Next button off and that the screen does not explain: that the **Name** field is missing, that there is not **exactly one key field**, and that some list field was left **with no options**, the one with the red pencil. The CRM permissions are adjusted in this same step, in the folded block at the top.

![Step 3: the summary before importing, with the detail of what failed](https://docs.audara.io/creacion-crm/imagenes/creacion-crm-archivo-3.jpg)

*Step 3: the summary before importing, with the detail of what failed*

Step 3 validates the whole file against the structure you have just built and gives you three numbers: how many **are going to be created**, how many arrive **incorrect** and how many are **duplicates**. The table below marks cell by cell what failed and why, with the reason under the value: a phone that is not a number, an email with no at sign, a repeated key.

The download arrows next to the incorrect ones and the duplicates pull those rows down to a CSV, so you can correct them and load them again without having to hunt for them in the original file.

> **In practice**
> The incorrect ones do not hold up the import: **Import** creates the good ones and leaves the rest out. Only if not a single good one is left does the button turn off, and that almost always means the separator or the mapping is wrong, not the rows. The healthy way is to download the file of incorrect ones, fix it and load it separately against the CRM once created, instead of starting the wizard over.

## Importing records into a CRM that already exists

The **Import** option of the list menu loads a CSV into a CRM that is already built. Here the structure is not touched: the columns of the file are matched against the fields that CRM already has. There are four steps.

![Step 1: you pick what you are going to load and upload the file](https://docs.audara.io/creacion-crm/imagenes/creacion-crm-importar-1.jpg)

*Step 1: you pick what you are going to load and upload the file*

The name of the CRM comes set and is not changed. The **Load as** selector says what the rows of the file are, and today the only option is **Contacts**: businesses are loaded by creating the CRM from a file, or created by hand.

![Step 2: what to do with what the file carries](https://docs.audara.io/creacion-crm/imagenes/creacion-crm-importar-2.jpg)

*Step 2: what to do with what the file carries*

- **Add as New Records**: Only creates. A row whose key already exists in the CRM is discarded.
- **Update Existing Records**: Only updates. A row whose key does not exist is discarded.
- **Both Options**: Creates the ones that were not there and updates the ones that were. It is what you want almost always.

Below, in grey, the screen reminds you which is the **Key Field** of that CRM, the one the rows are going to be compared against.

> **Important**
> The file **has to carry the column of the key field**. If it does not, step 3 never lets you go on and the screen does not explain why. That name in grey in step 2 is the one to look for in your file before going any further.

![Step 3: each column of the file against a field of the CRM](https://docs.audara.io/creacion-crm/imagenes/creacion-crm-importar-3.jpg)

*Step 3: each column of the file against a field of the CRM*

The difference from the other wizard is here: you do not pick types, you pick **fields that CRM already has**. A CRM field can only be matched with one column, and the sample column serves just as well to check it came out even. To move on to the last step nothing can be left in **Not Assigned**: whatever you are not going to import is erased with the bin. It also does not let you go on if a required field of the CRM was left unmatched, or if the key field is missing.

![Step 4: the summary, and the button that runs the load](https://docs.audara.io/creacion-crm/imagenes/creacion-crm-importar-4.jpg)

*Step 4: the summary, and the button that runs the load*

The last step validates and shows two numbers: how many records are going to be **created or updated** and how many arrive **incorrect**, with the same detail table and the same download of the bad rows. **Import** starts the load.

> **Note**
> While the import is running the CRM is left in the **Importing** state and cannot be edited or deleted. With big files it takes a while, and there is no need to stay on the screen: you can leave and come back to the list to see when it changed to Active.
