Lookup to existing data in related table and add new values to this table

1872
3
02-20-2019 06:33 PM
CateReilly
New Contributor

Is it possible to have a select_one field that instead of having the choices in the xls, references a field in a related table?  I have a survey that is used to do property inspections. It is a feature service hosted on our SDE with a number of related tables, one being Contacts and the relationship to this table is one to many.

 We have 5000+ contact names in our contacts table.  Ideally we would like the inspector to be able to look-up this table and if the name already exists select it in the field for Contact Name, but if it does not exist, be able to create a new contact name record.

I have looked at the PullData function and thought about having the contact names stored in the media file, but this also requires having all of the contact names listed in the Choices worksheet and the select_one field does not allow for new values to be added. 

Any suggestions as to how I could get around this problem would be greatly appreciated.

0 Kudos
3 Replies
by Anonymous User
Not applicable

Hi Cate,

No, this is not currently supported. Select one and select multiple can only reference choice lists or external choices lists. We have an open enhancement to support other types of lookup lists from other data sources, but currently no time frame on this enhancement.

Another way you could try and accomplish this is to update the CSV if the media folder automatically, this can be done via a pyhton script. It would be possible to therefore automate the CSV to be created from another feature table, and then upload it to the survey item: https://community.esri.com/groups/survey123/blog/2017/12/08/an-alternative-way-to-update-the-media-f... 

Phil.

0 Kudos
CateReilly
New Contributor

Hi Phil,

Thanks for your response, this makes sense for keeping an up to date drop down list of contact names.  Do you have any ideas how to get around having the option of both the look-up and adding a new name to this same form if the name is not in the look-up?

Cate

0 Kudos
by Anonymous User
Not applicable

Hi Cate,

Have you considered using the select_one or other? Using the or other on a select one or select multiple questions create a new text field in the feature layer that the user can then manually enter an answer into that is not in the lookup list. It does not automatically update or populate the previously used list, you will still need to do this as a post processing action after surveys are submitted.

If you want to see the answers from the select and the or other fields in the same field in feature service, you can set both that questions as null field types, so that they are not stored or require field in feature layer, and then use a calculation in a following field to pull the two answers into one question (which can be a hidden calculate question). That way the end user only see the two questions above (select one and the other) but the actual answers are being stored in one field combined together.

Phil.

0 Kudos