Having some problems with storing the data

I have 3 stimuli in the loop: a fixation cross, a numeral and a picture. The numeral is generated each time by a code (see pic.1)

The problem is that the numeral is not stored in a separate column in an excel file after finishing the experiment. However, it is stored in the other file, it is saved.

Is there any way to make the number save to the excel file using builder/coder/magic/whatever.

Thank you for your help!

If you want to save a value of a given variable to a column use

thisExp.addData(‘columnName’,variableName)
1 Like

Should I write down this code to the “Begin Routine” or somewhere else?

At the bottom of Begin Routine should be fine.

1 Like

That worked, thank you!

…just a small addition because I had to look up the experiment’s name for online experiments :slight_smile: The code in js is:

psychoJS.experiment.addData('columnName', variableName);

That code will appear automatically on the JS side if you use an Auto translate code component (which I highly recommend).

1 Like