Uploading app forms

Hello @diana

I have built an app to load in CHT , when i run the command to convert the fprm using cht-conf i get

ERROR Traceback (most recent call last):
  File "/usr/local/bin/xls2xform-medic", line 8, in <module>
    sys.exit(main_cli())
  File "/usr/local/lib/python3.8/dist-packages/pyxform/xls2xform.py", line 87, in main_cli
    warnings = xls2xform_convert(args.path_to_XLSForm, args.output_path,
  File "/usr/local/lib/python3.8/dist-packages/pyxform/xls2xform.py", line 18, in xls2xform_convert
    json_survey = xls2json.parse_file_to_json(xlsform_path, warnings=warnings)
  File "/usr/local/lib/python3.8/dist-packages/pyxform/xls2json.py", line 994, in parse_file_to_json
    return workbook_to_json(
  File "/usr/local/lib/python3.8/dist-packages/pyxform/xls2json.py", line 613, in workbook_to_json
    error_message += " Invalid question name [" + \
TypeError: can only concatenate str (not "bytes") to str

i have not concatenated any string with a byte or number in the excel sheet form …
Any thoughts or ever encountered such ?

Hi @cliff

Can you please share the form so I can reproduce the error?

Also, what version of cht-conf are you using?

thanks @gareth

i run
sudo python -m pip install git+https://github.com/medic/pyxform.git@medic-conf-1.17#egg=pyxform-medic to install cht-conf and i think its conf-1.17

I’ve requested access to the form.

1.17 is the pyxform version. If you type cht --version (or medic-conf --version) you should get the version of the cht-conf tool you’re running.

thanks @gareth

Access granted

its 3.9.1

Hello @cliff,

If you have not solved this already, the error message Invalid question name [ means that you have a question (name column of the survey worksheet) that starts with an invalid character that is not allowed. The error is thrown when you convert-app-forms. Fixing the name should resolve the issue.

Update: Looking at your form (thanks for granting access), you have a question name menatal _health that should not have a whitespace before the underscore. That is the cause of the error.
image

Let us know how it goes.

4 Likes

yeah thanks @kitsao :+1:,
the whitespace before the underscore was the culprit

1 Like