How to edit the name of a form in ODK Collect before submitting it, (as a draft)

These days the ODK application was updated for the boys who are in the field and we have noticed that the name of the form cannot be edited.

For us it is important to be able to put the ID and name of the site in case there is something pending or to be able to add photos to have it identified. I appreciate you helping us with this issue to be able to edit the name of the form.

1 Like

Details on this change are here: Collect manual instance naming will be removed in v2023.2

I'm guessing you haven't set the instance_name field on the settings worksheet in your xlsform if you were manually entering this?

If you put a question at the end of the form like "please enter the comment for the instance name" under field get_instance_comment, then in the cell under instance_name you can put ${get_instance_comment} and the form will be named similarly to how you were doing it previously.

You could also use form fields like a timestamp, enumerator ID etc and create the instance name as something like concat(${timestamp}, '_', ${enumeratorID}, '_', ${site}, '_', ${get_instance_comment}, to get more info in the instance ID.

I am using an if in the instance name field to prepend a flag on saved drafts so the users can sort and find the ones that need a specific outstanding detail entered, after which the if will resolve to the else condition and update the instance to remove the flag.


But I export the forms in XML files, the solution you are giving me is in the case that the forms are exported in XLSForm

1 Like

Hi @Julian_gp
Editing xml forms manually is also possible but you have to be careful. I would recommend creating a sample form in xls to see how what @ahblake shared is represented in xml after converting and then trying to add that to the xml form. It's not easy and might be error-prone but if that is your only option you have to try.

Are you using Build by any chance? If so, you can specify an expression for naming submissions by going to Edit > Form Properties... and then putting your expression in "Instance Name".

Build does not allow you to use ${} notation like XLSForm so in the example above, ${a_form_field} would be /data/a_form_field. Or as @Grzesiek2010 said you can modify your XML manually.

1 Like