How to setup a relevant question using "select_one_from_file" choice list?

320
4
Jump to solution
10-21-2022 12:28 AM
JoseBarrios1
Occasional Contributor III

Hello everyone!

Does anyone have a suggestion on how to setup a relevant question using "select_one_from_file" choice list? I basically have 2 levels of cascading select to filter a list of assets and sub-assets that belong to a particular location( see attachment). Selecting "Location A" , for example, will filter the "Assets type" list to only show the assets that belong to that location.  That was easy to set up as relevant question. The problem is that some Assets also have sub-Assets and I need to setup the select_one_from_file question to be visible only when the parent Asset have a sub-asset child. Any recommendation on how to accomplish this?

Thanks,relevant.png

 

JB

0 Kudos
1 Solution

Accepted Solutions
AndyMcClary
New Contributor III

Hi Jose,

This should work for you based on those snapshots:

string-length(pulldata('subAssetDescription_list','name','subAssetRPI_list',${assetDescription_list}))>0

More detail on the pulldata function can be found here: https://community.esri.com/t5/arcgis-survey123-blog/use-existing-data-in-your-survey-the-pulldata/ba...

Also, it's not critical but I'd recommend giving your fields and lookup lists different names - makes it a little easier to keep track of what you're referring to in your formulas. 

View solution in original post

4 Replies
AndyMcClary
New Contributor III

Hi,

I'd use the pulldata function for this - it will return the first matching value from the csv so if you combine it with string-length you can use it to test whether there are any subassets for the selected asset. In your example I would enter the following formula in the relevant column of the subasset field:

string-length(pulldata('SUB-Asset_name','Sub-Asset','Asset',${ASSET_FIELD}))>0

0 Kudos
JoseBarrios1
Occasional Contributor III

Hi AndyMcClary,

This is a great approach! Thank you so much for your input! I'm trying to implement the formula that you suggested but I am not sure what are the fields that I need to add to that formula. I try to enter some values but I keep getting an error of "fields are not available". 

string-length(pulldata('subAssetDescription_list','???','??',${?????}))>0

Here is a snap shot  of my actual data workflow. 

relevant_2.png

 

0 Kudos
AndyMcClary
New Contributor III

Hi Jose,

This should work for you based on those snapshots:

string-length(pulldata('subAssetDescription_list','name','subAssetRPI_list',${assetDescription_list}))>0

More detail on the pulldata function can be found here: https://community.esri.com/t5/arcgis-survey123-blog/use-existing-data-in-your-survey-the-pulldata/ba...

Also, it's not critical but I'd recommend giving your fields and lookup lists different names - makes it a little easier to keep track of what you're referring to in your formulas. 

JoseBarrios1
Occasional Contributor III

Thanks Andy,

The formula works great! Thank you for the help and for the suggestion on the fields names. This is the first time I'm using the "select_one_from_file"  with a csv and I though that you have to have the "name" and "label" columns for the choice list to work. Glad to know that it is not the case and I will change it to something more meaningful. Thanks once again for your help!

JB

Update: After a suggestion,  I did try to change the "name" column on the csv to a more meaningful name but it doesn't work without the name and label column. 

0 Kudos