Name of Form

105 views
Skip to first unread message

Johnny Knox

unread,
Jul 25, 2016, 4:27:18 AM7/25/16
to Kobo Users
When filling out a form is there a way to auto fill nae in the "name this form" section with data from within the questions.  For example I would name it FORM TYPE - STUDENT #.  Form Type would be the same for all forms, but student number would change based on their answer to the first question which is to ask for their student #.  Is it possible or must it always be done manually?

Tino Kreutzer

unread,
Jul 27, 2016, 9:24:19 PM7/27/16
to Kobo Users
Hi Johnny,

Yes, that's definitely possible! It will require making a change in the XLS Form version of the file. Add another column called instance_name. Below that you can write dynamic code how the instance should be name. For example: 

concat(${lname}, ‘-‘, ${fname}, ‘-‘, uuid())

This combines the name fields and UUID of the form as the instance name. 

Best,
Tino

On Mon, Jul 25, 2016 at 4:27 AM Johnny Knox <knoxj...@gmail.com> wrote:
When filling out a form is there a way to auto fill nae in the "name this form" section with data from within the questions.  For example I would name it FORM TYPE - STUDENT #.  Form Type would be the same for all forms, but student number would change based on their answer to the first question which is to ask for their student #.  Is it possible or must it always be done manually?

--
You received this message because you are subscribed to the Google Groups "Kobo Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kobo-users+...@googlegroups.com.
To post to this group, send email to kobo-...@googlegroups.com.
Visit this group at https://groups.google.com/group/kobo-users.
For more options, visit https://groups.google.com/d/optout.

Johnny Knox

unread,
Aug 5, 2016, 4:53:49 AM8/5/16
to Kobo Users
Thanks so much. Once I add the column instance_name in which row do I add the formula?

Also where can i learn the dynamic code?  i want it to be.  ST14A - NAME - 52

ID = Text: applicant_student_id_
Name = Text: name_of_applicant
## = Calculation Number: poutofp_calculation

Johnny Knox

unread,
Aug 5, 2016, 5:58:28 AM8/5/16
to Kobo Users
Ok i found more information on http://xlsform.org/ and I now understand it needs to be on the settings page.  However I'm still confused..  It says to add a column in settings, but the example also has a form_title and form_id column and I'm not sure what those are.

Johnny Knox

unread,
Aug 5, 2016, 6:07:19 AM8/5/16
to Kobo Users
Also is the 

concat()

code something from xlsform.org or is that javascript?

Tino Kreutzer

unread,
Aug 5, 2016, 5:31:42 PM8/5/16
to kobo-...@googlegroups.com
Hi Johnny,

Just add the formula in the second row, right below it (same as for form_title and other fields, see xlsform.org). You can use the example I sent earlier and then replace the question names ‘lname’ and ‘fname’ based on your needs. Just create a regular Note question to test the output more quickly. 

concat(${lname}, ‘-‘, ${fname}, ‘-‘, uuid())

Best,
Tino

Johnny Knox

unread,
Aug 8, 2016, 10:23:40 PM8/8/16
to Kobo Users
Thanks, does the concat() expression work in all cells?  Is that Javascript?

Tino Kreutzer

unread,
Aug 9, 2016, 3:18:18 AM8/9/16
to Kobo Users
No, it's xform calculation syntax, same as + - div mod, etc. Check the documentation on http://support.kobotoolbox.org/customer/en/portal/articles/1656563-how-to-use-calculate-questions and xlsform.org but also https://opendatakit.github.io/odk-xform-spec/#xpath-functions if you're interested in more advanced calculations you can use. 

Johnny Knox

unread,
Aug 10, 2016, 3:31:23 AM8/10/16
to Kobo Users
Thank You, this is the information I was looking for.  Appreciate the help!
Reply all
Reply to author
Forward
0 new messages