# Refer Answer to Table Column

In row labeling projects, you can speed up labeling by pre-filling answers based on data in your uploaded file (`.csv`, `.xlsx`, etc.).

To do this, configure **Refer answer to table column** for each question and map it to a specific column header in your dataset. The system then automatically populates answers using values from that column.

To configure this during project creation, go to step 3. Add a question, then open the **More settings** accordion, then select the column header the question should reference.

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

After completing the setup, open the project. The question is pre-filled with answers from the referenced column.

<figure><img src="/files/6EjU31hUJVnfcG6Ml7l6" alt=""><figcaption></figcaption></figure>

## **Configuring for nested questions**

Datasaur also supports **Refer answer to table column** for nested questions (child questions under a [grouped attributes](https://docs.datasaur.ai/data-studio-projects/lets-get-labeling/label-sets/pages/sjMjHjQsHtR5BrPf3PUF#id-12.-grouped-attributes) question). The grouped attributes question cannot reference a column directly, so you must configure the reference on its child questions.

You can configure this using the same steps as for regular questions.

Parsing behavior may vary depending on whether the parent or child questions allow multiple answers, as nested questions may need to split values into multiple groups, multiple items, or both. The next section explains how parsing works.

## Data parsing and separators

To support pre-labeling, certain characters in your data are used to split and group answers.

### **Multiple answers separator (**<mark style="color:red;">`;`</mark>**)**

If a question **allows multiple answers**, use a semicolon <mark style="color:red;">`;`</mark> to split values in a single cell into separate answers.

If the question **does not** allow multiple answers, the semicolon is ignored, and the entire cell value will be treated as a single pre-labeled answer.

**Example**

* **Question:** `Fruit?` (Type: Text)
* **Referred column cell data:** <mark style="color:red;">`Apple;Banana;Pear`</mark>
* **Result:** The system creates three pre-labeled answers: **Apple**, **Banana**, and **Pear**.

{% file src="/files/8Xc9p3jIYvt7n5Ww63xV" %}

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

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

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

### **Answer group separator (**<mark style="color:red;">`|||`</mark>**)**

{% hint style="info" %}
This separator is used only for **nested questions in grouped attributes** question.
{% endhint %}

The <mark style="color:red;">`|||`</mark> separator splits values in a single cell into **multiple answer groups**. This separator only works when the parent grouped attributes question **allows multiple answers**. Otherwise, all <mark style="color:$danger;">`|||`</mark> separators are ignored, and the cell is treated as a single group.

You can also use <mark style="color:$danger;">`|||`</mark> together with the multiple answers separator (<mark style="color:$danger;">`;`</mark>) to split values within each group.

**Requirements for group parsing**

* The **grouped attributes (parent)** question must be configured to **allow multiple answers**.
* The **nested question (child)** must reference the column containing the separators.
* The child question can optionally **allow multiple answers** to split values using <mark style="color:$danger;">`;`</mark> within each group

The system parses values differently based on your configuration:

* **Case 1**

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

  * **Parent question:** Allow multiple answers → Unchecked :x:
  * **Nested question:** Allow multiple answers → Checked :white\_check\_mark:
  * **Column data:** <mark style="color:red;">`A1;A2|||B1;B2`</mark>
  * **The resulting pre-labeled answer:**
    * Group 1: <mark style="color:red;">`A1`</mark>, <mark style="color:red;">`A2|||B1`</mark>, <mark style="color:red;">`B2`</mark>
* **Case 2**

  <figure><img src="/files/4ORbWofwSOBZkXojr3pr" alt=""><figcaption></figcaption></figure>

  * **Parent question:** Allow multiple answers → Checked :white\_check\_mark:
  * **Nested question:** Allow multiple answers → Unchecked :x:
  * **Column data:** <mark style="color:red;">`A1;A2|||B1;B2`</mark>
  * **The resulting pre-labeled answer:**
    * Group 1: <mark style="color:red;">`A1;A2`</mark>
    * Group 2: <mark style="color:red;">`B1;B2`</mark>
* Case 3

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

  * **Parent question:** Allow multiple answers → Checked :white\_check\_mark:
  * **Nested question:** Allow multiple answers → Checked :white\_check\_mark:
  * **Column data:** <mark style="color:red;">`A1;A2|||B1;B2`</mark>
  * **The resulting pre-labeled answer:**
    * Group 1: <mark style="color:red;">`A1, A2`</mark>\
      Group 2: <mark style="color:red;">`B1, B2`</mark>

## Test data example

1. Upload the file below during project creation:

{% file src="/files/2nbjDqbUiILVYI41no8x" %}

2. In step 2, enable **Convert first row as header**.

![](/files/OXTDC72BeGHpz5DPP8AK)

3. In step 3, configure the questions as follows:
   * **Question 1:** <mark style="color:red;">`Colors`</mark> (Type: Text)
     * Enable **Allow multiple answers**
     * Set **Refer to column:** <mark style="color:red;">`colors_available`</mark>

       ![](/files/wptpFDUJQttGBBWwlbNU)
   * **Question 2:** <mark style="color:red;">`Vehicle parts`</mark> (Type: Grouped attributes)
     * Enable **Allow multiple answers**

       * **Question 2.1:** <mark style="color:red;">`Part name`</mark> (Type: Text)
         * Enable **Allow multiple answers**
         * Set **Refer to column:** <mark style="color:red;">`part_names_and_tags`</mark>

       ![](/files/eyio2ioAfyumD5was8Pv)

### **Result**

After the project is created, the questions are automatically pre-filled based on the values in the `.csv` file.

![](/files/KXghWEUM2yHB09OIWs63)


---

# 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://docs.datasaur.ai/data-studio-projects/lets-get-labeling/label-sets/refer-answer-to-table-column.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.
