# Variable not defined despite being there

**URL:** <https://discourse.psychopy.org/t/variable-not-defined-despite-being-there/26137>\
**Category:** Builder\
**Created:** [November 23, 2021, 11:32am UTC](https://discourse.psychopy.org/t/variable-not-defined-despite-being-there/26137 "2021-11-23T11:32:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gjpstrain](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/gjpstrain/32/31756_2.png) [@gjpstrain](https://discourse.psychopy.org/u/gjpstrain)\
**Post date:** [November 23, 2021, 11:32am UTC](https://discourse.psychopy.org/t/variable-not-defined-despite-being-there/26137/1 "2021-11-23T11:32:30Z")

</div>

If this template helps then use it. If not then just delete and start from scratch.

**OS** (e.g. Win10):  
**PsychoPy version** (e.g. 2021.2.3x):  
**Standard Standalone? (y)**  
**What are you trying to achieve?:**

I am simply trying to get a text variable to appear on screen, and be moved on by a space bar press. My text is contained in a .csv in the same directory as the .psyexp file, and has two columns , one, “instructions\_text” contains experimental instructions, and the other “slide\_counter” contains text for a slide counter.

**What did you try to make it work?:**

In my loop I have put my instructions.csv file. In the text component in the routine itself I have written $instructions\_text. My loop is sequential.

**What specifically went wrong when you tried that?:**

When I try to pilot my experiment on Pavlovia, I immediately get the message that the instructions\_text variable is not defined. I have looked in the JS and Python code and the instructions.csv is getting recognised at the start.

Any help would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![suelynnmah](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@suelynnmah](https://discourse.psychopy.org/u/suelynnmah)\
**Post date:** [November 23, 2021, 12:08pm UTC](https://discourse.psychopy.org/t/variable-not-defined-despite-being-there/26137/2 "2021-11-23T12:08:00Z")

</div>

Hi there, would you mind sharing your experiment with me? Sometimes it could just be a typo or an extra space somewhere that’s causing that error

---

<div class="post-metadata">

**Author:** ![gjpstrain](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/gjpstrain/32/31756_2.png) [@gjpstrain](https://discourse.psychopy.org/u/gjpstrain)\
**Post date:** [November 23, 2021, 12:12pm UTC](https://discourse.psychopy.org/t/variable-not-defined-despite-being-there/26137/3 "2021-11-23T12:12:25Z")

</div>

Hi, yes you can find it here [Pavlovia](https://pavlovia.org/Strain/pilot_actual)

I have made it public so you can see it,

Cheers

---

<div class="post-metadata">

**Author:** ![suelynnmah](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@suelynnmah](https://discourse.psychopy.org/u/suelynnmah)\
**Post date:** [November 23, 2021, 12:22pm UTC](https://discourse.psychopy.org/t/variable-not-defined-despite-being-there/26137/4 "2021-11-23T12:22:59Z")

</div>

I checked and currently $instructions\_text is set to “constant”. You need to set it to “set every repeat” from the drop down. That should hopefully fix it.

---

<div class="post-metadata">

**Author:** ![gjpstrain](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/gjpstrain/32/31756_2.png) [@gjpstrain](https://discourse.psychopy.org/u/gjpstrain)\
**Post date:** [November 23, 2021, 12:30pm UTC](https://discourse.psychopy.org/t/variable-not-defined-despite-being-there/26137/5 "2021-11-23T12:30:32Z")

</div>

Thank you very much mate - I’m still unsure of the difference between constant and set every repeat, so I need to familiarise myself a bit more. Thanks again!
