Survey123 Connect PullData Compound Question

1357
4
Jump to solution
01-08-2019 08:56 AM
JeffDavis7
Regular Contributor

Hello,

I have created an XLSForm called Meter Change Form (see attached) that employs the use of the pulldata function.  Thanks should go out to James Tedrick for the assist getting me that far.

I have a new consideration or wrinkle that I require assistance.

For example...currently my "pulldata" allows me to type in an old meter number and it auto-populates the corresponding Account Number, Address, Route# and Seq# values.  This is great.

Is it also possible to add a pulldata calculation whereby I type in the Address and it auto-populates the Old Meter Number, Account Number, Route# and Seq# if the user didn't have the old meter number handy?

If so...how would this need to be incorporated into my XLSForm since the calculation records corresponding to these entries are already populated with my other pulldata requests?

Thank you in advance.

Jeff

0 Kudos
1 Solution

Accepted Solutions
Jim-Moore
Esri Regular Contributor

Hi Jeff

Thanks for providing the XLSForm.

One suggestion would be to add a select_one that prompts the user to specify if they have the old meter number OR the address. Based on the response, the user is prompted to enter the known value into another question (using relevant to present the applicable question). Then use an if statement to calculate oldmeternum: if user enters an old meter number, use this value; otherwise use pulldata to look up the meter number using the entered address. Your existing pulldata calculations should then work as normal. Please see an example attached.

If you do not wish to store these additional questions as fields in the feature service, use the 'null' option in the bind::esri:fieldType column.


This assumes one address has only one meter, and vice versa. The pulldata function is essentially a text lookup, so the user would have to enter the address or old meter number exactly as it appears in the CSV for it to get a match.

One way to ensure the old meter number or address is entered correctly would be to use select_one for these questions using the 'autocomplete' appearance so the user can filter/select from a drop-down list. The values would have to be added to the choices tab; if you have a very long list of addresses/meter numbers this might not be practical and may affect performance, in which case an external select might be useful (see Cascading and external selects—Survey123 for ArcGIS | ArcGIS  for more info).

Jim

View solution in original post

4 Replies
Jim-Moore
Esri Regular Contributor

Hi Jeff

Thanks for providing the XLSForm.

One suggestion would be to add a select_one that prompts the user to specify if they have the old meter number OR the address. Based on the response, the user is prompted to enter the known value into another question (using relevant to present the applicable question). Then use an if statement to calculate oldmeternum: if user enters an old meter number, use this value; otherwise use pulldata to look up the meter number using the entered address. Your existing pulldata calculations should then work as normal. Please see an example attached.

If you do not wish to store these additional questions as fields in the feature service, use the 'null' option in the bind::esri:fieldType column.


This assumes one address has only one meter, and vice versa. The pulldata function is essentially a text lookup, so the user would have to enter the address or old meter number exactly as it appears in the CSV for it to get a match.

One way to ensure the old meter number or address is entered correctly would be to use select_one for these questions using the 'autocomplete' appearance so the user can filter/select from a drop-down list. The values would have to be added to the choices tab; if you have a very long list of addresses/meter numbers this might not be practical and may affect performance, in which case an external select might be useful (see Cascading and external selects—Survey123 for ArcGIS | ArcGIS  for more info).

Jim

JeffDavis7
Regular Contributor

Hi Jim,

Thank you so much for replying to my posting.  Your instructions and provided example is exactly what I needed to get started. Thank you.

Something just occurred to me and I don't know if it is possible.  Hopefully you may be able to offer some wisdom to this postulate as well.  If it were possible to scan the barcode of the old meter and have it populate my Old Meter Number space in the form, would that also initiate the pulldata function for auto-populating the address, account number, route#, and seq#?  Or does the old meter number need be to manually added by keypad for the pulldata function to initialize?

Thanks and talk with you soon.

Jeff

0 Kudos
Jim-Moore
Esri Regular Contributor

Hi Jeff, glad you found the info helpful.

Regarding barcodes, as long as the string returned from the barcode matches an old meter number in your CSV it should initiate the pulldata on the other fields. Add a barcode question specifically for old meter number barcodes; then add a calculation on the old meter number question to read in the string from this barcode question.

If the string returned from the barcode includes extraneous information, you can use the method described here by Philip Wilson to extract the relevant part from string.

Jim

JeffDavis7
Regular Contributor

Hi Jim,

Thank you for the valuable follow-up.  Your instructions are perfect!  That's exactly what I needed to make it work just right.  My field crew department lead indicates there "shouldn't" be any extraneous values but your information reference to my previous posting of Phil's extract will have me covered.

Many thanks!

Jeff