Jr:choice-name resulting in TypeError

Hello Everyone,

Thanks for being such a great community.

I am using choice-name to extract the label of a field and use it in instance_name.
Form deploys without any issue. I can make a submission from mobile app and it goes well. However when I try to edit the submitted form in Enketo Express, I get error “TypeError: Cannot read property ‘querySelector’ of undefined”. If I remove choice-name calculation field, this error goes away.
I am totally lost at this point and would appreciate any comments/help on this.

Thank you
Mustafa

sample_branch_survey.xlsx (13.1 KB)

Welcome to the community, @mustafaarif! I tested the same at my end and it seems to work fine even with Enketo. FYR, here is the test I made with a slightly modified version of your form (only keeping the variables that are needed):

If you look at the left corner (just above the Upload you will see the record name that has been named based on the code you provided.

Reference xlsform that I tested:

sample_branch_survey.xlsx (11.7 KB)