# Problem with specifying allowed keys via script (or variable in xlsx file)

**URL:** <https://discourse.psychopy.org/t/problem-with-specifying-allowed-keys-via-script-or-variable-in-xlsx-file/15517>\
**Category:** Builder\
**Created:** [August 6, 2020, 8:57am UTC](https://discourse.psychopy.org/t/problem-with-specifying-allowed-keys-via-script-or-variable-in-xlsx-file/15517 "2020-08-06T08:57:56Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![holmit](https://avatars.discourse-cdn.com/v4/letter/h/e19adc/32.png) [@holmit](https://discourse.psychopy.org/u/holmit)\
**Post date:** [August 6, 2020, 10:24am UTC](https://discourse.psychopy.org/t/problem-with-specifying-allowed-keys-via-script-or-variable-in-xlsx-file/15517/4 "2020-08-06T10:24:17Z")

</div>

re:

> [@Michael](#):
>
> > [@holmit](#):
> >
> > The allowed keys are set to possibleKeys WITHOUT the $ that is otherwise use to set object properties,  
> > as indicated in an earlier post on the topic.
> 
> Can you show the post that says that? This is the opposite of what I’d suggest: that you _should_ use the prefix like `$possibleKeys` to indicate to Builder that you have provided a variable name rather than a literal list of keys.

In the below topic, the pen-ultimate message says that the dollar sign ($) should not be used.

> [@Specify allowed key responses in loop through conditions file](https://discourse.psychopy.org/t/specify-allowed-key-responses-in-loop-through-conditions-file/8322):
>
> \*\*Win10 \*\*PsychoPy version 3.07 I am looping over a keyboard response component and want to specify the allowed keys for each loop iteration in a conditions file. To do so, I set the value for “Allowed keys” to “$key” and created a conditions file with a column which looks like this: \*\*key ‘1’,‘2’,‘3’,‘4’,‘5’,‘6’,‘7’ ‘1’,‘2’,‘3’,‘4’,‘5’,‘6’,‘7’ ‘1’,‘2’,‘3’,‘4’,‘5’,‘6’,‘7’ ‘1’,‘2’,‘3’,‘4’,‘5’,‘6’,‘7’ ‘y’,‘n’ \*\* However, when I tried running the experiment, I got an error (see below). A…

It also makes sense, as in the builder view, the $ is already there in front of the allowed keys box

---

_[View the full topic](https://discourse.psychopy.org/t/problem-with-specifying-allowed-keys-via-script-or-variable-in-xlsx-file/15517)._
