Select to view content in your preferred language

auto select all the multiple choices without requiring users to select manually

122
6
Jump to solution
Thursday
KushShah
Emerging Contributor

Hi

I want to select all the multiple choice values returned from the search expression in appearance column of survey sheet. The choice values/list are populated from feature REST end point service field column called 'Operator' . Is there workaround to have automatically selected on the check boxes of the form? Additionally the default column stores pre-populated values checked but I don't know upfront the default values cause they will be returned only after intersection of geopoint with the feature service. 

Another alternative way that solve my issue is to auto display values from the choice options into the text box i.e. Operator1, Operator2 etc. or whatever returned into select_multiple show_pipe that I want to display horizontally instead. I have attached the test expression below.

I appreciate for any suggestions. Thanks!

0 Kudos
1 Solution

Accepted Solutions
Neal_t_k
Frequent Contributor

@KushShah This might work for you depending on how long the list is, But if you make of list of all possible answers that could show up in the search() and put that list in the default column, any item that is populated in the filtered search should show up checked.

The list should be separated by commas but no spaces e.g.:

Operator1,Operator2,Operator3,Operator4...

An excel cell can hold 32,767 characters. So this will only work if you entire list has less characters than that.

edit more thoughts on the list:  If your list is longer and you can subdivide some how,  You could make a csv with that subdivision and the truncated list,  then use the calculate column and  pulldata to get the subdivided list from the csv.

View solution in original post

0 Kudos
6 Replies
Neal_t_k
Frequent Contributor

@KushShah This might work for you depending on how long the list is, But if you make of list of all possible answers that could show up in the search() and put that list in the default column, any item that is populated in the filtered search should show up checked.

The list should be separated by commas but no spaces e.g.:

Operator1,Operator2,Operator3,Operator4...

An excel cell can hold 32,767 characters. So this will only work if you entire list has less characters than that.

edit more thoughts on the list:  If your list is longer and you can subdivide some how,  You could make a csv with that subdivision and the truncated list,  then use the calculate column and  pulldata to get the subdivided list from the csv.

0 Kudos
Neal_t_k
Frequent Contributor

As a followup, you can by-pass excels character limit by putting the entire list in a csv, and using pulldata to populate the list.  You would just have to use a text editor and not excel to make the csv.

csv  OperatorList.csv:

Name, List

OpList, "Operator1,Operator2,Operator3,Operator4..."

 

xlsx:

note  OpList  OpList  hidden  Calculation:  pulldata('OperatorList', 'List', 'Name', 'OpList')

Then in the calculation field of your search question: ${OpList}

0 Kudos
Neal_t_k
Frequent Contributor

Another follow-up it, appears I didn't take testing far enough. While it appears to work on the search question, it actually ignores the filter and selects everything.  So that won't work.

0 Kudos
KushShah
Emerging Contributor

Hi @Neal_t_k 

The first solution helps for me and that is exactly what I wanted. I hope I wouldn't max out the excel cell characters.
while your solution works for me, I am also curious, on this workflow. let say the operator multiple choice are shown (without checked). And when Operator1 is checked, I want to show the related/corresponding TypePipe1 on the other ShowType form box. Assuming that on the REST feature service 'Operator' field stores (Operator1, Operator2, Operator3...)values and TYPEPIPE field stores (Typepipe1, Typepipe2...etc.), how to filter and display TYPE values based on selection of Operator values? Do I have to put both fields list values in the 'choice' sheet of the xls document?

I really appreciated for taking your time resolving into this. Thanks alot!

0 Kudos
Neal_t_k
Frequent Contributor

This might also select the whole list you put in the default column regardless of how the question appears,  Check what it actually returns compared what you are expecting it to return.

0 Kudos
Neal_t_k
Frequent Contributor

Yes, both field lists on the choice tab and then setup another search question. Something like:

search('TYPEPIPE?url=https://services2.arcgis.com/FiaPA4ga0iQKduv3/arcgis/rest/services/Natural_Gas_Interstate_and_Intras...", 'matches','Operator',${Operator})

0 Kudos