# How to load conditions from excel in PsychoJS?

**URL:** <https://discourse.psychopy.org/t/how-to-load-conditions-from-excel-in-psychojs/15116>\
**Category:** Online experiments\
**Tags:** pavlovia\
**Created:** [July 17, 2020, 9:19am UTC](https://discourse.psychopy.org/t/how-to-load-conditions-from-excel-in-psychojs/15116 "2020-07-17T09:19:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lois\_mm](https://avatars.discourse-cdn.com/v4/letter/l/aca169/32.png) [@lois\_mm](https://discourse.psychopy.org/u/lois_mm)\
**Post date:** [July 17, 2020, 9:19am UTC](https://discourse.psychopy.org/t/how-to-load-conditions-from-excel-in-psychojs/15116/1 "2020-07-17T09:19:23Z")

</div>

Url (no credits assigned yet) : [https://pavlovia.org/run/G4ABM/testtest/html/](https://pavlovia.org/run/G4ABM/testtest/html/)

Description of the problem:  
Hi! I have a task in which I store my conditions in an excel file, then randomize them at the beginning of the experiment to run it. I am trying to load the excel file at the beginning of my experiment in Psycho JS. I compile directly on pavlovia so everything is synced online. The excel file is correctly synced and the path is ok. I’m using a trial handler:

```auto
trials = new TrialHandler({
        psychoJS: psychoJS,
        nReps: 1, method: TrialHandler.Method.SEQUENTIAL,
        extraInfo: expInfo, originPath: undefined,
        trialList: 'stimuliExcel.xlsx',
        seed: undefined, name: 'stimuliExcel'
    }); 

```

However, I get the following “unknown ressource” error each time I try to launch the experiment :

- when importing condition: stimuliExcel.xlsx
- when getting the value of resource: stimuliExcel.xlsx
- **unknown resource**

What could be done to resolve the problem?

You can find the excel file i’m trying to open here : [stimuliExcel.xlsx](https://discourse.psychopy.org/uploads/short-url/pILcz7WmiFV3mxdKXFHdiPHhgZp.xlsx) (11.2 KB)

Thank you for your help!

---

<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:** [July 17, 2020, 10:08am UTC](https://discourse.psychopy.org/t/how-to-load-conditions-from-excel-in-psychojs/15116/2 "2020-07-17T10:08:39Z")

</div>

It could be because the cursor is on column F, which isn’t within your data.

You should also start your code with stimuliExcel= instead of trials=

Based on your post, I’m assuming that you have checked that the Excel file is in html/resources online.

Best wishes,

Wakefield

---

<div class="post-metadata">

**Author:** ![lois\_mm](https://avatars.discourse-cdn.com/v4/letter/l/aca169/32.png) [@lois\_mm](https://discourse.psychopy.org/u/lois_mm)\
**Post date:** [July 17, 2020, 11:18am UTC](https://discourse.psychopy.org/t/how-to-load-conditions-from-excel-in-psychojs/15116/3 "2020-07-17T11:18:14Z")

</div>

Thanks a lot for your help, it works great !
