Select to view content in your preferred language

Autopopulate but for multiple fields at same time?

93
5
Jump to solution
yesterday
SteveCole
Honored Contributor

Developing a form for field staff to go out and do plant surveys. Some staff are comfortable specifying a plant code, but others are more comfortable with common or scientific names. I've developed the UI to have a 3 option choice (Code/Scientific/Common Name) and then based on that choice a group appears where there is a pulldown for the user to type what they're looking for and then a PullData in the Calculation column then autopopulates the other two fields.

All of this works just fine but there could be situations that a user may need to switch options, because they don't know the plant code or whatever. That could result in data loss so I have created three hidden fields which I'd like to populate with the relevant information as a "final" resting place for that information.

So, is there a way to populate the UI as I am currently doing *AND* populate the hidden fields at the same time?

 

The UI:

s123_groupOptionUI.jpg

The XLSForm:

s123_groupOptionExcel.jpg

Thanks!

Steve

1 Solution

Accepted Solutions
DougBrowning
MVP Esteemed Contributor

What I do is have the label column be Code    Scientific name    Common name all together with 4 spaces between each.

Then the user can search on any one of these all in one spot.

DougBrowning_0-1784744257467.png

Even if they just know part of the plant it narrows the list down to what is actually in their state.

DougBrowning_2-1784744692373.png

 

Then I set the name column to just be the code so that is all that gets stored so its all consistent.

DougBrowning_1-1784744446690.png

Works super slick.  Note I have 12 different state lists that are up to 60,000 each with no issues.

I use autocomplete with a calc of the state field to grab the correct CSV.  Using external csv for these big lists is much faster and I only load the state I need.

autocomplete search(${SpeciesListName}, "matches", "Plants", "Y")

Funny this is actually for our Wetland project also.  We do share our forms if you want them just pm me.

Hope that helps.

View solution in original post

5 Replies
Neal_t_k
MVP Regular Contributor

I think you are going to need some compound if statements somewhere.

Assuming your select_one's are relevant on plantSearchType question:

SpCode:  if(string-length(${comSpComName})>0, ${comSpCode}, if(string-length(${sciSpSciName}>0, ${sciSpCode},${codeSpCode}))

and then repeat for each of your other hidden fields.

If you want to reduce lines, you could put the appropriate pulldata()'s inside of the if's instead of calling the notes field and make those visible all the time. The get rid of the notes.

Otherwise you could try coalesce() for your hidden fields.

Solved: Is there a way to use the coalesce calculation wit... - Esri Community

You have it mostly there. 

 

DougBrowning
MVP Esteemed Contributor

What I do is have the label column be Code    Scientific name    Common name all together with 4 spaces between each.

Then the user can search on any one of these all in one spot.

DougBrowning_0-1784744257467.png

Even if they just know part of the plant it narrows the list down to what is actually in their state.

DougBrowning_2-1784744692373.png

 

Then I set the name column to just be the code so that is all that gets stored so its all consistent.

DougBrowning_1-1784744446690.png

Works super slick.  Note I have 12 different state lists that are up to 60,000 each with no issues.

I use autocomplete with a calc of the state field to grab the correct CSV.  Using external csv for these big lists is much faster and I only load the state I need.

autocomplete search(${SpeciesListName}, "matches", "Plants", "Y")

Funny this is actually for our Wetland project also.  We do share our forms if you want them just pm me.

Hope that helps.

SteveCole
Honored Contributor

Doug, I marked your answer as the solution. While it's not exactly what I was looking for, I think this approach can work and since I have to export the S123 information and import it into Access, I can use the Split function to just break up the answer into its respective parts when I import it into Access.

I follow up with a PM. Curious if you've tackled a particular need with your forms.

Thanks guys!

0 Kudos
Neal_t_k
MVP Regular Contributor

@SteveCole If you need the 3 in separate fields, do it as Doug describes,  then do your pulldata() based on the species code.   You would already have the code, so you would just need a Common Name and Sci Name calculation. 

SteveCole
Honored Contributor

Yeah, what I really like about Doug's approach is that it's just so much cleaner. You don't have to juggle the visibility of 3 group options and people can just type what they know and it should suggest it.

0 Kudos