# Need help in creating a variable

**URL:** <https://forum.getodk.org/t/need-help-in-creating-a-variable/43237>\
**Category:** Support\
**Tags:** form-design, odk-aggregate, odk-xlsform\
**Created:** [September 27, 2023, 12:01pm UTC](https://forum.getodk.org/t/need-help-in-creating-a-variable/43237 "2023-09-27T12:01:19Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![danbjoseph](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/danbjoseph/32/21901_2.png) [@danbjoseph](https://forum.getodk.org/u/danbjoseph)\
**Post date:** [September 29, 2023, 6:41pm UTC](https://forum.getodk.org/t/need-help-in-creating-a-variable/43237/2 "2023-09-29T18:41:20Z")

</div>

If you want to refer to an an answer from a previous question you can use the question name to use the answer as a variable. See: [https://docs.getodk.org/form-logic/#variables](https://docs.getodk.org/form-logic/#variables)

Here is an example of one list of options, that is filtered for a second question based on what was selected in the first.  
[filter-example.xlsx](https://forum.getodk.org/uploads/short-url/xGq7IDWh6PkC0WsIimErlWqHxeq.xlsx) (12.8 KB)

 ![Screenshot 2023-09-29 at 2.37.45 PM](https://getodk.b-cdn.net/uploads/default/original/3X/1/c/1c00018a1158c7aa91e3ca4933fcf141c003c1de.png)

Here is an example of a repeat group that repeats for each answer from a select\_multiple.  
[repeat-loop.xlsx](https://forum.getodk.org/uploads/short-url/aRCYYwWDZc7mC0fbyOFyUs8iqlj.xlsx) (16.8 KB)

 ![Screenshot 2023-09-29 at 2.39.52 PM](https://getodk.b-cdn.net/uploads/default/original/3X/3/6/3639b90d160194890178d730de89aef3113ca297.png)

Also, I noticed you tagged your post with `odk-aggregate`. If you are using Aggregate, please note that it has reached end-of-life and is [no longer being updated or supported](https://forum.getodk.org/t/aggregate-is-no-longer-being-updated/33742). Consider switching to [Central](https://docs.getodk.org/central-intro) because it's actively developed.

---

_[View the full topic](https://forum.getodk.org/t/need-help-in-creating-a-variable/43237)._
