# Pulling code component from conditions file

**URL:** <https://discourse.psychopy.org/t/pulling-code-component-from-conditions-file/31498>\
**Category:** Builder\
**Tags:** randomization, code\
**Created:** [October 21, 2022, 4:51pm UTC](https://discourse.psychopy.org/t/pulling-code-component-from-conditions-file/31498 "2022-10-21T16:51:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![RN1000000](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/rn1000000/32/35674_2.png) [@RN1000000](https://discourse.psychopy.org/u/RN1000000)\
**Post date:** [October 21, 2022, 4:51pm UTC](https://discourse.psychopy.org/t/pulling-code-component-from-conditions-file/31498/1 "2022-10-21T16:51:56Z")

</div>

**OS** Win10  
**PsychoPy version** 2022.2.4  
Hello,  
I’m trying to create an experiment that runs different code dependent on the conditions file (for use with LSL). I am unclear on what I need to do to prepare a code component to accept the variable in our conditions file as the code itself. below are screenshots of what I have prepared, any suggestions would be helpful.  
conditions file

 ![test3](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/1/c/1c016f231907b0b95e7ed1cfdc44c57305b5e045.png)  
code component  
 ![test2](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/0/2/028f11d2748e5deab208175bb23056ff9dd91f0c.png)

---

<div class="post-metadata">

**Author:** ![ajus](https://avatars.discourse-cdn.com/v4/letter/a/dc4da7/32.png) [@ajus](https://discourse.psychopy.org/u/ajus)\
**Post date:** [October 21, 2022, 9:38pm UTC](https://discourse.psychopy.org/t/pulling-code-component-from-conditions-file/31498/2 "2022-10-21T21:38:21Z")

</div>

Hi @RN1000000,

have you tried `exec(Trial)`?

---

<div class="post-metadata">

**Author:** ![RN1000000](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/rn1000000/32/35674_2.png) [@RN1000000](https://discourse.psychopy.org/u/RN1000000)\
**Post date:** [October 22, 2022, 10:23pm UTC](https://discourse.psychopy.org/t/pulling-code-component-from-conditions-file/31498/3 "2022-10-22T22:23:22Z")

</div>

Your feedback is greatly appreciated. It was very simple to figure out, just name the column of the responses as congruent, and use that instead of the number in the coding. Once again, thank you.  
Sincerely,  
RA
