Problem with customPrompt in survey

Hello and thanks in advance for your help.

I have developed a project where I have defined a customPrompt based on select/multiple select prompt. I have setup a handlebar file, the javascript file and I have included a prompt_types worksheet with prompt_type_name and type columns in the xls. The type is array.

It is working correctly in the application designer chorme preview tool but when I push the project to the android handset and try to run survey, the app crashes. I see the following error in the log:

E/createOrOpenTableWithColumnsAndProperties: 2018-06-05 02:26:38.409 org.opendatakit|java.lang.IllegalArgumentException: malformed elementType – cannot declare an object or array having no children: object dbHandle: uuid:2704bd71-8254-4775-837f-b38d3fdb9004
java.lang.IllegalArgumentException: malformed elementType – cannot declare an object or array having no children: object
at org.opendatakit.aggregate.odktables.rest.ElementType.parseElementType(ElementType.java:131)
at org.opendatakit.database.data.ColumnDefinition.getType(ColumnDefinition.java:559)
at org.opendatakit.database.data.ColumnDefinition.buildColumnDefinitions(ColumnDefinition.java:195)
at org.opendatakit.database.data.OrderedColumns.(OrderedColumns.java:47)
at org.opendatakit.services.database.utilities.ODKDatabaseImplUtils.createOrOpenTableWithColumnsAndProperties(ODKDatabaseImplUtils.java:2497)
at org.opendatakit.services.database.service.OdkDatabaseServiceImpl.createOrOpenTableWithColumnsAndProperties(OdkDatabaseServiceImpl.java:508)
at org.opendatakit.services.database.service.OdkDatabaseServiceInterface.createOrOpenTableWithColumnsAndProperties(OdkDatabaseServiceInterface.java:356)
at org.opendatakit.database.service.AidlDbInterface$Stub.onTransact(AidlDbInterface.java:390)
at android.os.Binder.execTransact(Binder.java:682)

Can you please tell me how should I define it? where can I find documentation or an example for that? I have seen examples with the pulseox object where properties.pulse.type and properties.ox.type are included in the worksheet but in my case there are no adittional fields.
Why does it work in the emulator and not in the real survey?

What I need to save in the custom fields of the in the database is:
[“item1”,“item3”,“item21”,“Item33”,“item2”,“item95”], this is what the chrome emulatar saves.

This is an example of what it has defined In the _colum_definitions table for one of these fields:
43 tableName zona_delantera zona_delantera array [“zona_delantera_items”]

For some reason it does not create the same in the handset.

I am usiing odk services and ODK survey 2.0.3 rev 220 in samsung device with android 8. ODK 2.0 rev 214a for the application designer web tool.

Thanks again

Is there a reason that you are on ODK 2.0.3 rev 220? If you could move to the latest version, that would be great. This helps to ensure that we are debugging relevant issues.

In order to customize the select_multiple prompt type, you have to add a model sheet where you define your custom select_multiple prompt to be of type array and also define the items.type to be of type string. Doing this in addition to the handlebar file, JavaScript file, and prompt_types worksheet ought to fix the problem. I have included a zip file custom_select_multiple.zip (11.8 KB) with an example xlsx form and customPromptTypes.js file. I have also confirmed that the form works on ODK 2.0.5.

Let me know if you run into other issues.

Thanks so much for your help Clarice.

I was using 2.0.3 because that is the one that was available in google play, I deleted it and downloaded 2.0.5 from github repository.

I have deleted the opendatakit folder and apps from my handset and installed 2.0.5 of services, tables and app designer too. I have made a fresh instalation of your example and unfortunatelly I get the same error. I cannot understand why it works for you and not for me but it is driving me crazy.

Please find attached the config folder. I have included the log file too. I have only uploaded your xlsx file to the xlsx converter, have not changed anything and throws the same error as I had with mine when I push it to the handset and run survey.

It works perfectly in the app designer emulator.
config.zip (971.9 KB)

Thanks again for your help!!