# How to add data to the output file in PsychoJS?

**URL:** <https://discourse.psychopy.org/t/how-to-add-data-to-the-output-file-in-psychojs/15152>\
**Category:** Online experiments\
**Tags:** pavlovia\
**Created:** [July 19, 2020, 4:48pm UTC](https://discourse.psychopy.org/t/how-to-add-data-to-the-output-file-in-psychojs/15152 "2020-07-19T16:48:29Z")\
**Posts on this page:** 4\
**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 19, 2020, 4:48pm UTC](https://discourse.psychopy.org/t/how-to-add-data-to-the-output-file-in-psychojs/15152/1 "2020-07-19T16:48:29Z")

</div>

URL of the experiment: [https://pavlovia.org/run/G4ABM/testtest/html/](https://pavlovia.org/run/G4ABM/testtest/html/)

Description of the problem:  
Hi!  
I’m trying to add data to the default output generated by Psychopy on Pavlovia (which is a csv file).  
However, when I use the following JS script at the end of a routine, nothing is registered :

```auto
psychoJS.experiment.addData("test","test")

```

If I’m not mistaking, this is supposed to create a column “test” and write “test” in this one at the end of each routine on the CSV.  
The experiment works without crashing but there is no “test” on the CSV.

What should I do?

If you have a suggestion to create a different output (from scratch) it can also be something to consider.

Thanks a lot !

---

<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 19, 2020, 5:37pm UTC](https://discourse.psychopy.org/t/how-to-add-data-to-the-output-file-in-psychojs/15152/2 "2020-07-19T17:37:59Z")

</div>

You need quotes around the column name, unless it’s a variable

---

<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 19, 2020, 5:55pm UTC](https://discourse.psychopy.org/t/how-to-add-data-to-the-output-file-in-psychojs/15152/3 "2020-07-19T17:55:43Z")

</div>

@wakecarter sorry I forgot them in my post, they are actually written in the code.  
Fixed the post.

---

<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 19, 2020, 6:02pm UTC](https://discourse.psychopy.org/t/how-to-add-data-to-the-output-file-in-psychojs/15152/4 "2020-07-19T18:02:54Z")

</div>

Try putting a loop around the routine (nReps=1 with no Excel file). I’ve sometimes had problems locally with saving data not associated with a loop.
