> For the complete documentation index, see [llms.txt](https://docs.wem.io/platform/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wem.io/platform/template-editor/miscellaneous/reference.md).

# Reference

## ![](/files/RrgMAjaRixlQpg440uAR) Introduction

The Reference is used to reference a row in your database.&#x20;

## Properties&#x20;

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

***Reference -*** This refers to the field that is used for the reference.&#x20;

***Visible when -*** This allows you to show/hide the Reference container based on certain conditions that you might want to set. However, the same result can also be achieved using Conditionals. And it is recommended to use Conditionals instead of this property, mainly because the condition is then not hidden in the properties panel, but immediately visible to someone looking at the Template Editor. This improves readability.&#x20;

## Illustration&#x20;

Let's build upon the EMS use case from where we had left at in the page for 'Nested template'. We had built an interaction template with a Tabbar consisting of two tabs and nested templates.&#x20;

Now, the project has a new requirement to add a 3rd tab called 'Employees' that would show the list of employees. And against each employee, it should show the projects that he/she is assigned to, along with the client name of the project.&#x20;

For this, we would need to build a new Template Fragment called 'Employees', add a 3rd value called 'Employees' to the Concept item that corresponds to the Tabbar, and then add this Template Fragment under a new Conditional in the Template Editor.&#x20;

Below is the new 'Employees' Template Fragment. The third column has a Repeater to show the project id, project name and client name of the project in a Table.&#x20;

{% hint style="info" %}
Refer the pages for [Repeater](/platform/template-editor/miscellaneous/repeater.md) and [Table](/platform/template-editor/layout/table.md) if you would like to familiarize yourself with the topics.&#x20;
{% endhint %}

<figure><img src="/files/2jPrY5DjXvRGwr4LXPmP" alt=""><figcaption><p>'Employees' template fragment</p></figcaption></figure>

As you see, each column in the Table inside the Repeater has to be prefixed with the reference variable `[Employees.Employees.EmployeeProjects.RefProj] ->`. As requirements grow more complex, you will end up doing this for many more columns.&#x20;

This can of course be simpified and we can get rid of using the above reference variable prefixed to each column. For that, we use the Reference widget.&#x20;

1. In the last column, add a Repeater for 'Employee Projects' datalist.&#x20;

   <figure><img src="/files/aRehDNKe8KYt2QAtYS5f" alt=""><figcaption></figcaption></figure>
2. Click on the 'Reference' icon and drag it to the canvas inside the Repeater. This would prompt you to select a reference field.&#x20;

   <figure><img src="/files/zbjYmPvErgTJDitTD4XD" alt=""><figcaption><p>Adding Reference widget</p></figcaption></figure>

   Alternately, drag and drop the reference variable on to the canvas, wherever needed.&#x20;

   <figure><img src="/files/CIF0wApIcmJpHbP5KILQ" alt=""><figcaption><p>Adding reference widget - alternate way</p></figcaption></figure>

Reference container is added.

<figure><img src="/files/u23DDNkBXaSF3hC7I0er" alt=""><figcaption><p>Reference container added</p></figcaption></figure>

3\. Add a Table inside the widget and add fields from the 'Projects' table. This time, you do not have to prefix each field with  `[Employees.Employees.EmployeeProjects.RefProj] ->` , because it is already part of the umbrella Reference widget. &#x20;

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

4\. This produces the below screen at run-time.&#x20;

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

##


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://docs.wem.io/platform/template-editor/miscellaneous/reference.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.
