How to use Form Components, I use form and meet a problem

ValueError: Item -12349872349873in items file ‘Items.xlsx’ is missing a required value for its response type. Permitted types are {‘free text’, ‘choice’, ‘slider’, ‘description’, ‘rating’, ‘radio’, ‘heading’}.

please help me

1 Like

I just had the same problem and found the answer - my form was correct, but I saved it in .csv (MD-DOS) rather than .csv (UTF-8)…

How does it work in detail

For forms I think you need to use csv files, not xlsx

thank you

I’m using a MacBook and encountering the same issue when uploading an .xlsx file. I’ve tried to save the file as several types of .csv files (MS-DOS, UTF-8, and the Macintosh type) and none of them seem to work either. Instead, the following error message comes up:

UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xd5 in position 396: invalid continuation byte

Is this a problem with my computer?

Thanks in advance!

For forms I think you need to use csv files, not xlsx

Maybe you run into the same error as me:

tldr:

  • use the csv file format
  • save csv with commas as delimiter (under some circumstances a semicolon will be used)

To achieve the last one: use libreoffice or some other application. Excel will mess with your files and change the delimiter without you noticing.

I’ve tried using libreoffice to change it to a csv file but unfortunately I now get a different error message…

UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xd5 in position 396: invalid continuation byte

I think it may be a MacBook issue. I will try to use a windows computer and see if I run into the same issue. Thanks for your advice!

If you upload your xlsx file here, I’m sure someone would be happy to convert it to a plain CSV.

Apple should not be the problem here.
PsychoPy needs UTF-8 Unicode encoded files but you’re feeding it some other character set. This is an easy fix, though:

  1. Save the file with libreoffice in the csv format

  2. Change the character set (Zeichensatz) to Unicode UTF-8 and the delimiter (Feldtrenner) to a comma
    image

I have a similar problem, do you think it’s also due to a mistake in csv? I used to template form in Excel and then converted it to csv but I have Error message:
logging.error(msg)
UnboundLocalError: local variable ‘msg’ referenced before assignment
################# Experiment ended with exit code 1 [pid:9952] #################

Here are some suggestions about that error.

Here’s the solution using Excel:

File → Options → Advanced

Uncheck “Use system operators”

Set “Decimal separator” to .
Set “Thousands separator” to ,

Save as CSV UTF-8 to make sure.

I’m encountering this error, 6 months later. Happens regardless of .csv or .xlsx. Any tips?

Error:
UnboundLocalError: local variable ‘msg’ referenced before assignment

I’m running an extremely simple test file, and nothing seems to be working.

EDIT: I was able to get past this error by eliminating quotes around the type entry, in this case ‘choice’ → choice. However, the radio are now giving me strange behavior: a click in one radio button displays a selection dot to the right. I’m giving up for now and will use Qualtrics. A sad day.

I recommend checking this: