# Formula Linked Definitions using UI

## **1. Creation** <a href="#id-1.-creation" id="id-1.-creation"></a>

### **1.1 Existing formulas** <a href="#id-1.1-existing-formulas" id="id-1.1-existing-formulas"></a>

The list shows existing formulas and their status

<figure><img src="https://3006114282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXVOaWpJKxLZf1Tee9eCO%2Fuploads%2F8PcdIkMHzTla45prF5Xg%2Fimage.png?alt=media&#x26;token=3604ef33-3dc5-4848-965b-f455ebb9c2ad" alt=""><figcaption></figcaption></figure>

### **1.2 New formulas** <a href="#id-1.2-new-formulas" id="id-1.2-new-formulas"></a>

New formula can be created by clicking on the ‘Create New’ button in the corresponding UI form.

<figure><img src="https://docs.hedera.com/~gitbook/image?url=https%3A%2F%2F1556785885-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FNYWPEEAknX9Vki1yV5HY%252Fuploads%252Fgit-blob-e24dfa501f78cb73c35e58b2e8e18469b3926731%252F1%2520%2825%29.png%3Falt%3Dmedia&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=2e70ceb4&#x26;sv=2" alt=""><figcaption></figcaption></figure>

<figure><img src="https://docs.hedera.com/~gitbook/image?url=https%3A%2F%2F1556785885-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FNYWPEEAknX9Vki1yV5HY%252Fuploads%252Fgit-blob-aa6b9ea2a6dc6370c6e2bcbde88c667ac669e488%252F2%2520%2827%29.png%3Falt%3Dmedia&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=b8eb80a0&#x26;sv=2" alt=""><figcaption></figcaption></figure>

### **1.3 Configuration** <a href="#id-1.3-configuration" id="id-1.3-configuration"></a>

After a formula is created it needs to be configured.

<figure><img src="https://docs.hedera.com/~gitbook/image?url=https%3A%2F%2F1556785885-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FNYWPEEAknX9Vki1yV5HY%252Fuploads%252Fgit-blob-88c23965c076fade49382a9f5c037b7ebb4de240%252F3%2520%2823%29.png%3Falt%3Dmedia&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=1e666745&#x26;sv=2" alt=""><figcaption></figcaption></figure>

#### **1.3.1 Basic configuration**

Basic configuration of Formulas include name and description. It is advisable to use meaningful texts for these configuration options to enable viewers to easily understand the meaning and the purpose of the formula.

<figure><img src="https://docs.hedera.com/~gitbook/image?url=https%3A%2F%2F1556785885-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FNYWPEEAknX9Vki1yV5HY%252Fuploads%252Fgit-blob-a01f5c89b319a6b3bb6e6ec949d27135edda6ba1%252F4%2520%2821%29.png%3Falt%3Dmedia&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=f22f525e&#x26;sv=2" alt=""><figcaption></figcaption></figure>

#### **1.3.2 Math configuration**

Formulas can be composed from the unlimited number of items of the 4 types (as shown in the screenshot below):

* Constants
* Variables
* Formulas
* Text

<figure><img src="https://docs.hedera.com/~gitbook/image?url=https%3A%2F%2F1556785885-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FNYWPEEAknX9Vki1yV5HY%252Fuploads%252Fgit-blob-a396903dbc538fdbd14b6343800f6cf654bfe209%252F5%2520%2824%29.png%3Falt%3Dmedia&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=23fcbad2&#x26;sv=2" alt=""><figcaption></figcaption></figure>

**1.3.2.1 Constants**

Constants are variables with fixed values. Definition of constants contain Name, Description and Value.

<figure><img src="https://docs.hedera.com/~gitbook/image?url=https%3A%2F%2F1556785885-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FNYWPEEAknX9Vki1yV5HY%252Fuploads%252Fgit-blob-cd28137d2ba0ef6566e9a1b67211b6928f03e47b%252F6%2520%2823%29.png%3Falt%3Dmedia&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=b1761b15&#x26;sv=2" alt=""><figcaption></figcaption></figure>

**1.3.2.2 Variables**

Variables in Formulas represent data from documents. Variables can be linked with specific fields in schemas (using “Link” field). Similarly to ‘Constant’, ‘Variable’ definitions also contain Name and Description fields.

<figure><img src="https://docs.hedera.com/~gitbook/image?url=https%3A%2F%2F1556785885-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FNYWPEEAknX9Vki1yV5HY%252Fuploads%252Fgit-blob-2401904c415775501e7ca0744fbbe05eb19d86ea%252F7%2520%2823%29.png%3Falt%3Dmedia&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=b605a994&#x26;sv=2" alt=""><figcaption></figcaption></figure>

*Link –* special field which links variables to a schema field, or a component of another formula.

<figure><img src="https://docs.hedera.com/~gitbook/image?url=https%3A%2F%2F1556785885-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FNYWPEEAknX9Vki1yV5HY%252Fuploads%252Fgit-blob-2e9ea4ba4e045cde242bd44e3a7a654e7f54a115%252F8%2520%2823%29.png%3Falt%3Dmedia&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=a7b0e5b9&#x26;sv=2" alt=""><figcaption></figcaption></figure>

<figure><img src="https://docs.hedera.com/~gitbook/image?url=https%3A%2F%2F1556785885-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FNYWPEEAknX9Vki1yV5HY%252Fuploads%252Fgit-blob-c88c105646466c298aecfdff7b92d07bb931a56c%252F9%2520%2820%29.png%3Falt%3Dmedia&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=ca2df6af&#x26;sv=2" alt=""><figcaption></figcaption></figure>

<figure><img src="https://docs.hedera.com/~gitbook/image?url=https%3A%2F%2F1556785885-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FNYWPEEAknX9Vki1yV5HY%252Fuploads%252Fgit-blob-3380b7858e628ae02a420db6283d341eda5cae07%252F10%2520%2821%29.png%3Falt%3Dmedia&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=93fd5950&#x26;sv=2" alt=""><figcaption></figcaption></figure>

**1.3.2.3 Formulas**

Formula definitions can be re-used in other formulas. Formulas are defined using LaTex notation.

<figure><img src="https://docs.hedera.com/~gitbook/image?url=https%3A%2F%2F1556785885-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FNYWPEEAknX9Vki1yV5HY%252Fuploads%252Fgit-blob-aeba94e94e9fef9324aa436719369f434d76ccdf%252F11%2520%2818%29.png%3Falt%3Dmedia&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=726146b0&#x26;sv=2" alt=""><figcaption></figcaption></figure>

<figure><img src="https://docs.hedera.com/~gitbook/image?url=https%3A%2F%2F1556785885-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FNYWPEEAknX9Vki1yV5HY%252Fuploads%252Fgit-blob-e1268477c86ffca45f726283a42f1d9d232ce77a%252F12%2520%2816%29.png%3Falt%3Dmedia&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=e1a5e15&#x26;sv=2" alt=""><figcaption></figcaption></figure>

<figure><img src="https://docs.hedera.com/~gitbook/image?url=https%3A%2F%2F1556785885-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FNYWPEEAknX9Vki1yV5HY%252Fuploads%252Fgit-blob-2328f308ce608f6306489611f1f570825d0ee73a%252F13%2520%2816%29.png%3Falt%3Dmedia&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=87f5be74&#x26;sv=2" alt=""><figcaption></figcaption></figure>

*Link* – a special field which indicates the field in the document schema where the result of the calculation is located.

<figure><img src="https://docs.hedera.com/~gitbook/image?url=https%3A%2F%2F1556785885-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FNYWPEEAknX9Vki1yV5HY%252Fuploads%252Fgit-blob-33ed7f5fdd2d3c24fa50f06e518bea3feba5e9c8%252F14%2520%2813%29.png%3Falt%3Dmedia&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=a232e244&#x26;sv=2" alt=""><figcaption></figcaption></figure>

Relationships – to enable navigation in a Formula using its variables, the list of these variables must be defined in the corresponding field.

<figure><img src="https://docs.hedera.com/~gitbook/image?url=https%3A%2F%2F1556785885-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FNYWPEEAknX9Vki1yV5HY%252Fuploads%252Fgit-blob-97a615e136183f87e7a848add95d4086d45ab512%252F15%2520%2815%29.png%3Falt%3Dmedia&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=d42448b9&#x26;sv=2" alt=""><figcaption></figcaption></figure>

**1.3.2.4 Text**

Text - a component which allows the description of the calculation algorithm without using mathematical notation. This component does not require any specific syntax.

<figure><img src="https://docs.hedera.com/~gitbook/image?url=https%3A%2F%2F1556785885-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FNYWPEEAknX9Vki1yV5HY%252Fuploads%252Fgit-blob-ec349f888bbe87e861137566b35cfe9bf8c04569%252F16%2520%2814%29.png%3Falt%3Dmedia&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=c99b615a&#x26;sv=2" alt=""><figcaption></figcaption></figure>

## **2. Publishing** <a href="#id-2.-publishing" id="id-2.-publishing"></a>

Formulas are linked to Policies and are only meaningful in the context of a Policy. Formulas can be published at the same time as the corresponding Policies, or separately after the Policy has been published. In the later case the Policy archive file will not include Formula definitions but otherwise will also be fully functional.

<figure><img src="https://docs.hedera.com/~gitbook/image?url=https%3A%2F%2F1556785885-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FNYWPEEAknX9Vki1yV5HY%252Fuploads%252Fgit-blob-bcc4a6a7480436878e723231049465d98b288b88%252F17%2520%2815%29.png%3Falt%3Dmedia&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=14f55abd&#x26;sv=2" alt=""><figcaption></figcaption></figure>

## **3. Viewing** <a href="#id-3.-viewing" id="id-3.-viewing"></a>

Formulas are accessible via the corresponding button for all document which have linked formulas.

<figure><img src="https://docs.hedera.com/~gitbook/image?url=https%3A%2F%2F1556785885-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FNYWPEEAknX9Vki1yV5HY%252Fuploads%252Fgit-blob-ecb7c20cd937747fbbc1dd004e6cdc4c52cf818d%252F18%2520%2813%29.png%3Falt%3Dmedia&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=560eea92&#x26;sv=2" alt=""><figcaption></figcaption></figure>

The Formula display dialogue shows all linked formulas and provides facilities to navigate through the components of these formulas.

<figure><img src="https://docs.hedera.com/~gitbook/image?url=https%3A%2F%2F1556785885-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FNYWPEEAknX9Vki1yV5HY%252Fuploads%252Fgit-blob-5a1cc3f6313cfe133d929a8d3a6ca6977e3a9312%252F19%2520%2811%29.png%3Falt%3Dmedia&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=24b43286&#x26;sv=2" alt=""><figcaption></figcaption></figure>

<figure><img src="https://docs.hedera.com/~gitbook/image?url=https%3A%2F%2F1556785885-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FNYWPEEAknX9Vki1yV5HY%252Fuploads%252Fgit-blob-a99fc5908e89d95026fd5b46645ade49f4917af2%252F20%2520%288%29.png%3Falt%3Dmedia&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=d557e377&#x26;sv=2" alt=""><figcaption></figcaption></figure>

## **4. Access** <a href="#id-4.-access" id="id-4.-access"></a>

Policy Author users can create and edit formulas. Formulas are visible to all uses which access to the documents to which formulas are linked.

## **5. Import\Export** <a href="#id-5.-import-export" id="id-5.-import-export"></a>

Formula definitions can be exported into a file.

<figure><img src="https://docs.hedera.com/~gitbook/image?url=https%3A%2F%2F1556785885-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FNYWPEEAknX9Vki1yV5HY%252Fuploads%252Fgit-blob-8331408c8863d36b2b6c2811b6338d7d6e15b3ac%252Fimage%2520%28799%29.png%3Falt%3Dmedia&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=105862c6&#x26;sv=2" alt=""><figcaption></figcaption></figure>

Corresponding, Formula definition can be imported from a file.

<figure><img src="https://docs.hedera.com/~gitbook/image?url=https%3A%2F%2F1556785885-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FNYWPEEAknX9Vki1yV5HY%252Fuploads%252Fgit-blob-899bdaa9e0af19efee88271b37a477d0c80da9c5%252Fimage%2520%28800%29.png%3Falt%3Dmedia&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=748dbb6d&#x26;sv=2" alt=""><figcaption></figcaption></figure>
