Survey 123 questions

1518
5
02-10-2017 10:23 AM
BethHoobler
New Contributor II

Ismael Chivite‌ can you please help with a few questions?

1. Can you get rid of the circles in a drop down list (select_multiple with minimal appearance)?

2. How do you parse a bar code that is comma delimited to return data in certain labels? For example, I want a, Johnson, b, Eric to return Johnson in my Last Name and Eric in my First name. 

3. What is the best way to populate Survey 123 data back to a sql database? 

Thanks in advance.

Tags (2)
0 Kudos
5 Replies
JamesTedrick
Esri Esteemed Contributor

Hi Beth,

1) You can't remove the circles/boxes next to the items in minimal appearance select_ones and select_multiples - they are there to help identify which value(s) are selected (this is especially important for select_multiple)

2) There isn't a function within the XLSForm spec to parse variable length strings, only based on character position (many barcode formats also are position-based)

3) There are several ways to populate a sql database.  One method would be to use an ArcGIS Server service with the database and have Survey123 post to it directly - see Use Survey123 with ArcGIS Server—Survey123 for ArcGIS | ArcGIS .  You could also have a migration script run to copy over the data from the hosted feature service to your database - see https://community.esri.com/groups/survey123/blog/2016/12/14/migrating-data-from-the-survey-feature-s... 

BethHoobler
New Contributor II

Thank you!

BethHoobler
New Contributor II

I successfully added the barcode information in. Seems like you can only use a text field and not a select_multiple to get it to work. The workaround for this would be to hide that initial field and then set up another field to display the information from that. For example the barcode captures 0 for non residency and 1 for resident. I want to display NR and Res accordingly. Is there some way that I can hide that first question (that dispalys 0 or 1) and set up relevancy in another? I see there is a type of question called "hidden" but I don't know if it will work with bar codes or how to set it up. Thanks. 

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Beth,

Yes, barcodes are text fields with a camera control to scan the barcode- the value is intended to be populated only through scanning, as opposed to selection.  To accomplish the resident/nonresident display, that would need to be a separate question that calculates it's value baed on the barcode question. As an example, let's say that a barcode field has the following text: A015BC , where the 3rd character (1, in this case) is the NR/Res indicator as you describe above.  The substr() function can extract a particular value out of the barcode string, and the if() function can test which value it is.  The calculation would be something like:

if(substr(${barcode}, 2, 3) = "0", "NR", "Res")

Note that the substr() function begins counting at 0, so the 2 is the third character.

More information on functions can be found at Formulas—Survey123 for ArcGIS | ArcGIS 

BethHoobler
New Contributor II

Worked beautifully. Thank you so much!!!!!!

0 Kudos