> ## Documentation Index
> Fetch the complete documentation index at: https://docs.h3aven.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

An entity is the place to store data. Think of it like a simple excel sheet. It has columns - h3aven's parameters - and it has rows - h3avens entity-data
Sometimes we call it "database" instead of "entity" - the terms may be use interchangeably on this doc

Allowed entity parameter types allowed on the API are:

Simple types:

* ATTACHMENT
* IMAGE
* SIGNATURE
* CPF
* TIME
* URL
* HTML
* CEP
* CPFCNPJ
* CNPJ
* DATE
* DATETIME
* EMAIL
* NUMBER
* PHONE
* TEXT
* TEXTAREA
* CURRENCY
* PERCENTAGE

Parameters that require the definition of the optionItems variable:

* SELECT - select a single element in a list of options - select input style
* CHECKBOX - select multitple elements in a list of options
* RADIO - select a single element in a list of options - radio style
* TOGGLE - select a single ement in a toggle input style - boolean

Advanced types

* LOCATION: Gets the user location with the browser's permission
* ENTITY\_RELATION: defines a connection with another database. variable `entityRelationId` (the id of the other entity) and `entityRelationParameterId` (the parameter of the other entity) are required.
* USER: select a user from the org

These ones are also possible, but via front-end configuration:

* COMPUTED\_NUMBER: when you configura a sheet integration. The computed number is the result of an excel formula wiht numbers
* COMPUTED\_TEXT: when you configura a sheet integration. The computed number is the result of an excel formula with text
* PDF\_RENDERER: Upload a PDF attachment and see it rendered on the view pages

Steps processes are the elements which will set the right permissions for the right user to create, update or delete a new entry on the Entity

Sometimes you might want to connect one entity to another.
Some example use cases:

1. Entity A holds client information, entity B holds the contracts for that client. Many contracts for the same client
2. Entity A holds company information, entity B holds the addresses for that company around the world. Many addresses (or none) for the same company

To do this, you must set 2 variables in Entity A:

* entityRelationId: the id of entity B - is the variable that will make the connection possible
* entityRelationParameterId - the id of the parameter of entity B. is the variable that will define which parameter will the user see from entity B when checking data from entity A

this is an body example for creating or updating entity A, after creating entity B:

```json theme={null}
{
  "name": "Entity A",
  "parameters": [
    {
      "name": "relation",
      "type": "ENTITY_RELATION",
      "label": "entity relation",
      "entityRelationId": "entityB.id",
      "entityRelationParameterId": "entityBParameter.id"
    }
  ]
}
```

There is a third optional parameter that will act as a helper for entity A, when selecting data for entity B.
param `entityRelationAuxParamIds` on entity A is a list of parameter ids from entity B, and it will show up when choosing a line to connect from entity B on entity A

```json theme={null}
{
  "name": "Entity A",
  "parameters": [
    {
      "name": "relation",
      "type": "ENTITY_RELATION",
      "label": "entity relation",
      "entityRelationId": "entityB.id",
      "entityRelationParameterId": "entityBParameter.id",
      "entityRelationAuxParamIds": [
        "entityBParameter2.id",
        "entityBParameter3.id",
        "entityBParameter4.id"
      ]
    }
  ]
}
```
