# Randomise sliders with different labels

**URL:** <https://discourse.psychopy.org/t/randomise-sliders-with-different-labels/31901>\
**Category:** Builder\
**Created:** [November 11, 2022, 4:33pm UTC](https://discourse.psychopy.org/t/randomise-sliders-with-different-labels/31901 "2022-11-11T16:33:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![faye3309](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/faye3309/32/35860_2.png) [@faye3309](https://discourse.psychopy.org/u/faye3309)\
**Post date:** [November 11, 2022, 4:33pm UTC](https://discourse.psychopy.org/t/randomise-sliders-with-different-labels/31901/1 "2022-11-11T16:33:30Z")

</div>

Hi,

For my task, I will randomize 6 trials with 2 sliders in each. Sliders in different trials have different labels.

I tried to set the label in each slider referring to the value in the condition file, but an error message indicated that the parameter is not define. Does anyone know how I can display the labels differently in different trials and randomly present them to participants? Many thanks!

Ist slider in a trial

 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/8/1/81074b3ec4f06cb52ecb3043078bb0d7c501839a.png)

2nd slider in a trial

 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/f/d/fdd58787a830ec976708ddfe5ca4de7f1a9cf144.png)

Flow:  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/e/8/e8cd32839c0152942e62f0fbb38bf763e6ce2bbd.png)

Condition file:  
[condsov.xlsx](https://discourse.psychopy.org/uploads/short-url/aeLP4LkTq575YnKmlqNVwVW5Gzv.xlsx) (10.1 KB)

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [November 14, 2022, 10:42pm UTC](https://discourse.psychopy.org/t/randomise-sliders-with-different-labels/31901/2 "2022-11-14T22:42:05Z")

</div>

This thread might help.

> [@How to set slider values to variable from .xlsx?](https://discourse.psychopy.org/t/how-to-set-slider-values-to-variable-from-xlsx/21894/8):
>
> Setting labels after initialisation is difficult, but not impossible! If you have the same number of labels each time, you could do this: # Get labels list for this routine labels = efflabels.split(",") # For each label... for i, obj in enumerate(mySlider.labelObjs): # ...set its text to be the corresponding value in labels, and store this in the slider obj.text = mySlider.labels[i] = labels[i] (the initial value of labels would need to be the same number of values as in efflabels sepa…
