# Field Correlation

The use case for this function is leave application. There is two master data as below:\
\
1\. Leave Type Master Data\
2\. Leave Balance Master Data

In the leave application form, when the applicant selects a leave type (sourced from the leave type master data), the system should automatically populate the applicant's leave balance, which is stored in the leave balance master data, by utilizing the Field Correlation function.&#x20;

Below are the steps to configure Field Correlation:

## 1. Create an action flow

<figure><img src="/files/atBrGwgGfPv0yOg9I2vQ" alt=""><figcaption><p><strong>Create a new action flow in the leave manegement application</strong></p></figcaption></figure>

<figure><img src="/files/xlMqjmcVC8HzVr5nTlR3" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/zjywsS46yegLLeTtgT2p" alt=""><figcaption><p><strong>Choose User-defined Event Triggering</strong></p></figcaption></figure>

<figure><img src="/files/lMEpZfRp5EvG9GUNtPSB" alt=""><figcaption><p><strong>Click input Parameter Settings</strong></p></figcaption></figure>

<figure><img src="/files/K9hHBhs3SERCqM0HF9I5" alt=""><figcaption><p>Add two parameter 1. applicant and 2. leavetype<br>Note: The values for these parameters will be taken from the Leave Application form field inputs.</p></figcaption></figure>

<figure><img src="/files/0xjCTzDICE8hsRmQkMNp" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/o6EowJVdAk4gDe9hEvyE" alt=""><figcaption><p><strong>Add a Data Source Query operation to retrieve data from the Leave Balance Master Data.</strong></p></figcaption></figure>

<figure><img src="/files/iX9P9J0keVlGVL6Pzrh1" alt=""><figcaption><p><strong>For Data Source, select the Leave Balance Master Data in Leave Management Application</strong></p></figcaption></figure>

<figure><img src="/files/T6yBbjpBYdS0U7qplJEA" alt=""><figcaption><p><strong>For Conditions, add two filter</strong> <br><strong>1. Staff Name equal to the first parameter (applicant)</strong><br><strong>2. Leave Type equal to second parameter (leavetype)</strong></p></figcaption></figure>

<figure><img src="/files/EL1V0Xofj8jGITUzBuJf" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/xWjjnI6VZ4CrbhSk4IJj" alt=""><figcaption><p><em>Note: This filter ensures that the system only retrieves data from the Leave Balance Master Data that matches these two conditions.</em></p></figcaption></figure>

<figure><img src="/files/aKweuwlWApDzcX2pkB0o" alt=""><figcaption><p><strong>For Query Field, select Leave Balance and Used</strong></p></figcaption></figure>

<figure><img src="/files/IHxbAk0otBnK0TeViVZI" alt=""><figcaption><p><strong>For Operator, select any of the personnel.</strong><br><em>Note: Operator refer to who execute this query action. In actual case, HR will be the operator.</em></p></figcaption></figure>

<figure><img src="/files/MgK4oK30oRXZVgeoe27W" alt=""><figcaption><p><strong>Click Output Parameter Settings</strong></p></figcaption></figure>

<figure><img src="/files/GoIz1fIsFeDKcm6zIPzA" alt=""><figcaption><p><strong>Add two parameter 1. leavebalance and 2. used. Then, select dynamic assignment and assign the corresponding query field to each parameter.</strong></p></figcaption></figure>

<figure><img src="/files/L3ZsyywuCDcDyoW9TdSo" alt=""><figcaption><p><em>Note: The data retrieved from the Leave Balance Master Data is assigned to the leavebalance and used parameters, which will then be input into the corresponding fields in the Leave Application form.</em></p></figcaption></figure>

<figure><img src="/files/wtnl7cmApjThUVxWqs6d" alt=""><figcaption><p><strong>Save and enable the action flow</strong></p></figcaption></figure>

<figure><img src="/files/1Sk5B16NPVy7vQjGGQMk" alt=""><figcaption><p><strong>Give a name for the action flow and save</strong></p></figcaption></figure>

### 2. Configure field correlation in leave application form

<figure><img src="/files/nDJJznDUCl1mdq8eUIZQ" alt=""><figcaption><p><strong>Click field correlation button</strong></p></figcaption></figure>

<figure><img src="/files/IvFVE1knDb9D1gE2y4T9" alt=""><figcaption><p><strong>Add a new correlation</strong></p></figcaption></figure>

<figure><img src="/files/3ix6E5QFDLiRKTqPkBDV" alt=""><figcaption><p><strong>For Trigger Action, select Leave Type and click on the +Add button.</strong><br><em>Note: The Trigger Action refers to the condition that determines when to execute the field correlation. In this case, the field correlation is triggered when the Leave Type value is changed.</em></p></figcaption></figure>

<figure><img src="/files/2sDlVHGPW1H61DedV6JK" alt=""><figcaption><p><strong>For the Query Method, select ESB as the action flow is used to trigger the field correlation. Then, choose the action flow that was created earlier.</strong></p></figcaption></figure>

<figure><img src="/files/ZblgQ4xfm7svB2b90xkn" alt=""><figcaption><p><strong>For Input Parameter, select form fields and choose the Applicant and Leave Type.</strong><br><em>Note: This means that the values of Applicant and Leave Type in the Leave Application form will be assigned to the parameters to execute the action flow, which will search the Leave Balance Master Data for records that match these two conditions.</em></p></figcaption></figure>

<figure><img src="/files/SnSabqut5MeOmdOHRiqC" alt=""><figcaption><p><strong>For Input Parameter, select form fields and choose the Leave Balance and Used.</strong><br><em>Note: This means that the values of the parameters (leavebalance and  used), retrieved from the Leave Balance Master Data, will be assigned to the Leave Balance and Used fields in the Leave Application form.</em></p></figcaption></figure>

<figure><img src="/files/HizAiSN7xSfXt1xbR9AD" alt=""><figcaption><p>Save the settings and form</p></figcaption></figure>

#### 3. Preview and test

<figure><img src="/files/g71n7CnxEvivIYPJi0I9" alt=""><figcaption><p>Preview the Leave Application form</p></figcaption></figure>

<figure><img src="/files/AtLm3ONeYy5guFQwjiVx" alt=""><figcaption><p>Select a Leave Type, the Leave Balance and Used will be automatically populated</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://echelp.weaver.com.co/e-builder/field-correlation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
