> For the complete documentation index, see [llms.txt](https://help.metaforms.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.metaforms.ai/survey-programming-decipher/complexity-support/datasource.md).

# Datasource

Metaforms supports a wide range of Data Source Setups in your surveys.

Let's take a look at all of them:

**Datasource setup using variable declared in the extraVariables attribute of survey tag.**\
\
Maps survey variables defined in the extraVariables attribute of the survey tag to datasource fields for data retrieval and pre-population.

Match source from URL with ID in dataset.

* **Mapping Process:**
  * Survey Variable: source (defined in extraVariables attribute)
  * Dataset Field: ID (unique identifier in external datasource)
  * Functionality: Matches the source value from URL parameters with corresponding ID
* **Example Flow:**
  * Survey URL contains: \`?source=12345\`
  * System searches datasource for record where \`id=12345\`
  * Retrieved data pre-populates designated survey questions
* **Auto populate text question from the datasource**

  \
  !\[A close up of a paper

  AI-generated content may be incorrect.]\(<https://lh7-rt.googleusercontent.com/docsz/AD\\_4nXf5ij2UT2p\\_NuTdYRdMqIh4CLlZB\\_dpacA3HJSDm6mGAYT4uKaXj2066YmqcZP23qW4RsONVsTrr\\_h-Iz5SqkxShByf\\_uUp2RCRfl8TRbM8fcdsqLvcTvVUF6-\\_ayd-iOA\\_fAG1m5zbWoMd9Im1TkA?key=odNjgDDDn4vmZj3NahWsig>)<br>
* **Auto populate text question with rows from datasource**\
  \
  !\[A close up of a paper

  AI-generated content may be incorrect.]\(<https://lh7-rt.googleusercontent.com/docsz/AD\\_4nXc5FktrBY4HIqDuy9knBv1zJX25Yx5V92M7bvfP3NPctAWCQfmhaP2jCtRX9BijUKpPKiC\\_IabnmeGQFj2ugQ-KcsW-pIavPwPtq1zRcjGPhnWxuYsF6t3smwoTnnd7EHDnr12HtwjsGxLkJa4GPhI?key=odNjgDDDn4vmZj3NahWsig>)<br>
* **Auto populate number question from datasource**\
  \
  !\[A close up of a paper

  AI-generated content may be incorrect.]\(<https://lh7-rt.googleusercontent.com/docsz/AD\\_4nXeJW-C\\_tDUj\\_Yu0Hy9j-78TA4Ub2DsUXZnvaKZjpWbfFj2xTYenxn-Ii0HJRf1nrKaupPyFkaxZpG8KAWVM-C9A1xm5VVysa7MINbqluHPaU0hs95fR2DKN13Amo3DgLkeBVyz1ZK2He5Ym4gDhkg?key=odNjgDDDn4vmZj3NahWsig>)<br>
* **Auto populate number question with rows from datasource**

  \
  !\[A close up of a paper

  AI-generated content may be incorrect.]\(<https://lh7-rt.googleusercontent.com/docsz/AD\\_4nXfsa22IYY2ihoyAjhjve0Sez9IC6Q2PebMdyZRjBQTXlSBu7wNjZAte\\_P-rwDyD7U-jtm3X6R5KGDZwzvEYXeBDpSKW5YrA9C7XFbQRiojAPhJhj8eiSmDKAWl0MtZpd49udkKGgHGMHMIaIF1HJnM?key=odNjgDDDn4vmZj3NahWsig>)
* **Auto populate float question from datasource**\
  \
  !\[A close up of a piece of paper

  AI-generated content may be incorrect.]\(<https://lh7-rt.googleusercontent.com/docsz/AD\\_4nXfnrivP1gWnWtt7IPMd01G2o7SGQHe6czqh8gIaAnu-9qYksuLthlZQadEHVlkX52ZdHtsZzAz1hkL1u6lpQ0Emni9NRnPaVRiZKaJ2tzqyYzd8sXlcKpkkgau1SnwuzTQmttycd0lHuaLj2JggNA0?key=odNjgDDDn4vmZj3NahWsig>)
* **Auto populate number question with rows from datasource**\
  \
  !\[A close up of a piece of paper

  AI-generated content may be incorrect.]\(<https://lh7-rt.googleusercontent.com/docsz/AD\\_4nXfAgMpDY7q9fCba-zfyN\\_XHsRCP3LLEYqJefnQ2ViSLZCr0LkF\\_oZ\\_243yi6U6CZvBtNJ0jA4ThSwATIhJzZiPPsXWjh1ssJoft8Pw3hLbo8hE8RjQJn\\_L8W6if-p7PkTL9t7RO\\_Q1gH2DaXw5rhVo?key=odNjgDDDn4vmZj3NahWsig>)<br>
* **Auto populate radio question with rows from datasource**\
  \
  !\[A close up of a paper

  AI-generated content may be incorrect.]\(<https://lh7-rt.googleusercontent.com/docsz/AD\\_4nXfvequJXSpRQkTNH4Yn-jk0Fdamu33pAiXW\\_ocspEY2dUVfWEMgD\\_1J-UpwQtfXea9PPHCpRXI376kp2hT7\\_AVKxLfI0UHJVrLhZS5t2pKdZ2WV4rlMh6KZk\\_yMdP8fw9dqPH9PXPTfdmfHg-2ayQ?key=odNjgDDDn4vmZj3NahWsig>)<br>
* **Auto populate radio question with columns from datasource**

  \
  !\[A screenshot of a computer

  AI-generated content may be incorrect.]\(<https://lh7-rt.googleusercontent.com/docsz/AD\\_4nXcNJxbru3bce6SzZOBHxbwvcHSROQw617YBojEDNnkAWoQ2lfhZaG57KnqMgR4im68FntCDHMCgQnj2ZSfJzSxjQmNuuhBCsF70JRF\\_MKiAt0q9eyn1eXH4xAa6WSwv-oVuCgHrAmIjY27U9gXQJ4k?key=odNjgDDDn4vmZj3NahWsig>)<br>
* **Auto populate radio question with rows and columns from datasource**

  \
  !\[A screenshot of a computer

  AI-generated content may be incorrect.]\(<https://lh7-rt.googleusercontent.com/docsz/AD\\_4nXdIYlWjIR4S9Y2qmVjUMCw4Mmpkw8Uupqx5KxBXFr5eNfNP8Xevu-Cda1Jd39oj1uOWEJk9iiC-YOwG1deyaetADFeoZ66QyrnjjGmmQnkEwsenMx1m-5mZzQSEpQxnMZh4vFX738B1liRqAyunWdY?key=odNjgDDDn4vmZj3NahWsig>)<br>

**Datasource Setup using variable declared in one of the sample source in survey**

Maps sample source variables to datasource fields for data retrieval and pre-population survey questions.

* **Mapping Process:**
  * Sample Source Variable: userId (from sample source tag)
  * Dataset Field: userId (unique identifier in dat file used for datasource file)
  * Functionality: Matches userId from sample source with corresponding userId in external datasource
* **Example Flow:**
  * Sample source variable contains: \`userId=ABC123\`
  * System searches dat file used in the datasource for record where \`userId=ABC123\`
  * Retrieved data auto-punches designated survey questions
* **Auto populate text question from datasource using sample source variable**\
  \
  !\[A close up of a paper

  AI-generated content may be incorrect.]\(<https://lh7-rt.googleusercontent.com/docsz/AD\\_4nXdSoiM-ZXxYo82AQ8aOFnJ8-\\_7etpVgOcQThs7olK1pUELsst49zTh8P8uqMemChrhgvCFaf6COXiD3G2Ux3Qp4SX-KmHxUiL0ePebUoneSMz\\_0TkHh1uLVuWrWOZGXQlFwLItzXIRlQxYOTuzamwE?key=ZxoeILFEXEnA5iq85boyaw>)<br>
* **Auto populate text question with rows from datasource using samplesource variable**\
  \
  !\[A close up of a paper

  AI-generated content may be incorrect.]\(<https://lh7-rt.googleusercontent.com/docsz/AD\\_4nXeI4zQZLNh\\_BEO0zJ96MAftLP7mOCi3jYPGTn1m8jJ8SEEGb90OVX75eBC1EfIqwBeIZvcQkzAzh0oh6N\\_SR34DKLQxuM3PRkZ5zOkx-qLIDkeyUA4Kf5w6klA-Shwu6c4xp1-fAtfHvmTBFDLTppo?key=ZxoeILFEXEnA5iq85boyaw>)<br>
* **Auto populate number question from datasource using samplesource variable**\
  \
  !\[A white crumpled paper

  AI-generated content may be incorrect.]\(<https://lh7-rt.googleusercontent.com/docsz/AD\\_4nXeMvUduJ17kqU-\\_YlEfWVzxmRaq2mRlX1MNcWbKRuZyuUxSWNNuf-YIJVOndvzLa-jfj7xConh6fWbgnqNLf0R4FZcIQi0P-YasceTT3WUg1\\_0D38H7pbJS6zEsIJZrQJHGa\\_o4AxG5GjHTuC0rUg?key=ZxoeILFEXEnA5iq85boyaw>)
* **Auto populate number question with rows from datasource using samplesource variable**\
  \
  !\[A close up of a paper

  AI-generated content may be incorrect.]\(<https://lh7-rt.googleusercontent.com/docsz/AD\\_4nXcZapMJimuFV7Hyn5k53\\_\\_Lo2bHEiA3vpIa7kpZ7fn6gV9k6TiuEqOv7snVdgw63Ej7lagMJxnr6kUAhyQepCmxr6xnDJI\\_9Di0rEOLCLb\\_PnkmhvxTec\\_Ehvq4u5T2EPhibcUfRlDjH7jayAxA3cI?key=ZxoeILFEXEnA5iq85boyaw>)<br>
* **Auto populate float question from datasource using samplesource variable**\
  \
  !\[A close up of a paper

  AI-generated content may be incorrect.]\(<https://lh7-rt.googleusercontent.com/docsz/AD\\_4nXeZNITiaWodJOlhoGBNp1YQ0lPLbnCbUlMIXQkf8WbnK21h9mdH0P\\_aVDN4VDLFA95RPckumjqopxs3kDn0hTiJjuuAMmZnc5dMq9BP9QHcvX3tT24M\\_OusTqyuUIUABA3N\\_xp\\_nPbasXJexHcAA\\_U?key=ZxoeILFEXEnA5iq85boyaw>)<br>
* **Auto populate float question with rows from datasource using samplesource variable**\
  \
  !\[A close up of a paper

  AI-generated content may be incorrect.]\(<https://lh7-rt.googleusercontent.com/docsz/AD\\_4nXejROSWamAzU7jjVgLh5NI72IV9xePuiSVJfU0Ju5cbYeXKY-VlLFUCCs3kmtvKXpRpxIG-KiB\\_jcgvkkhB50XSJjqATnOqW8O1QVgonMDBOY1E8tYmm1\\_UF\\_SA76Bg9uSA0v6J\\_bYDcjZfE\\_1-H40?key=ZxoeILFEXEnA5iq85boyaw>)<br>
* **Auto populate radio question with rows from datasource using samplesource variable**\
  \
  !\[A close up of a paper

  AI-generated content may be incorrect.]\(<https://lh7-rt.googleusercontent.com/docsz/AD\\_4nXeujr2cpfdS7T3cnPl6I\\_6sKVqRZYj6W03G3aOv2pB9Rbx6b-Rf9j75FN\\_NPzFLTagTshQOUY60VI1\\_bglNXC-Gq1r48DqVjUphFnDogWIfIXv48RWV22tH2CdfRE9ze8QwkGxchtcrmIqUzfsXhGk?key=ZxoeILFEXEnA5iq85boyaw>)<br>
* **Auto populate radio question with columns from datasource using samplesource variable**\
  \
  !\[A screenshot of a phone

  AI-generated content may be incorrect.]\(<https://lh7-rt.googleusercontent.com/docsz/AD\\_4nXdnlsaFLeDLnygO7-e2Zd6QWF9gvY\\_wiL8Jmp\\_tataumnA1y-o4Sc3e9CgHJLt4LQdF5zhig7Y9RlAEbLeAEeWI77pBuSJxboPkR7yBrRDAjbA0SjnZjPkEGDgWawwqJhPRK2WVAKAv8blgBwXAlTs?key=ZxoeILFEXEnA5iq85boyaw>)<br>
* **Auto populate radio question with rows and columns from datasource using samplesource variable**\
  \
  !\[A screenshot of a computer

  AI-generated content may be incorrect.]\(<https://lh7-rt.googleusercontent.com/docsz/AD\\_4nXfFGChZ6\\_EhWMVwYrwRJAKk6\\_uKPH8WE1fcZbOcSJFd4WUeWOVF95-qYKD50VnXlEP29I611aBgQ5zg1JwtXT5sNUNM6uaVgFucYZstTv7kmIkdlEm37eoq3Aw2w1B8XWUt5veebvKERQFw5axAug?key=ZxoeILFEXEnA5iq85boyaw>)<br>
* **Auto populate checkbox question from datasource using samplesource variable**\
  \
  !\[A close up of a paper

  AI-generated content may be incorrect.]\(<https://lh7-rt.googleusercontent.com/docsz/AD\\_4nXcDDKLwguhfc6acpVqFSyrt97JW4ztoLHI6pBDWEPEQkhkq02ip1bbgFIdysrwGg3H-v27yTE-awchYFZo52I7LGDeP3maxHdMi2-SXb8hQZn4Y\\_\\_GXFsr7T-6lfjAcfVhxglmTanCOdDHyfWVJCQ?key=ZxoeILFEXEnA5iq85boyaw>)<br>
* **Auto populate checkbox question with columns from datasource using samplesource variable**\
  \
  !\[A screenshot of a computer

  AI-generated content may be incorrect.]\(<https://lh7-rt.googleusercontent.com/docsz/AD\\_4nXcpjY1keNw8XZMj1JPEGZjdZKkyZtltDuMo5jqDTutg57\\_vRGfc78982IlSOHPDQBL5xIjSvp2HJ4JO-wuNoRzBqvzfdfobpIX2aVACuFn6YJyk6H1vBYt-P-cDMqh4DbXZgLLJHBEK0R4A1KwtTjs?key=ZxoeILFEXEnA5iq85boyaw>)


---

# 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, and the optional `goal` query parameter:

```
GET https://help.metaforms.ai/survey-programming-decipher/complexity-support/datasource.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
