# Changing selected rows using variable in JS

**URL:** <https://discourse.psychopy.org/t/changing-selected-rows-using-variable-in-js/9264>\
**Category:** Online experiments\
**Created:** [October 1, 2019, 3:49pm UTC](https://discourse.psychopy.org/t/changing-selected-rows-using-variable-in-js/9264 "2019-10-01T15:49:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lrier](https://avatars.discourse-cdn.com/v4/letter/l/ea5d25/32.png) [@lrier](https://discourse.psychopy.org/u/lrier)\
**Post date:** [October 1, 2019, 3:49pm UTC](https://discourse.psychopy.org/t/changing-selected-rows-using-variable-in-js/9264/1 "2019-10-01T15:49:47Z")

</div>

Description of the problem:  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/e/d/eddf8be802d8171abde980a57bb1a817fd175560.png)

I have a condition file for my routine trial which contains all possible trials.  
I wanted to use a subset of these trials for each block using a separate condition-file in the ‘blocks’ loop.  
My blocks.xlsx file contains a single column called trial\_rows where each entry is a string such as 1,2,3,4,5,6 which specifies which rows should be selected in my trial loop:

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

This works perfectly well in the local version. In the online version, the trial routine is only called once for each block.

Do I have to store the selected rows in a different format?
