I have a select multiple list of possible "Pole Issues" , one of the options being "NO_ISSUE". I want to default this to "NO ISSUE" but after any other option is selected the default to be removed. Is this possible?
You can apply a constraint on the the combination of 'no issue' and other answers. This would require the user to unselect the 'no issues' choice before proceeding. The constraint message can also be added to help guide the user.
Have not tested it but a sample constraint could be something like the below (constraint is not having more than one selection if 'no issues' is selected).
not(selected(., 'no_issues') and count-selected(${issues})>1)
https://support.esri.com/en/technical-article/000020969
https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformformulas.htm#ESRI_SECTION1_8979CBF8B7354DA9A4FE0F6B6D61E1A0
An alternate approach to this scenario is to have two questions and add relevancy:
Please don't forget the kudos 🙂
I appreciate the response! I am trying to eliminate clicks and make it as easy as possible for the guys in the field. This did work but its adding clicks. I went ahead and just removed "NO_ISSUE" from the choices list and will just know moving forward if blank it will indicate "NO_ISSUE".
You can do this fairly easily using javascript.
The script itself is three part process. First convert the answer to a string, then check if the string contains any answers other than "no issue". If there are other answers, delete the "no issues" response and keep the rest.
I've attached an example. The modified answer is currently visible so that you can see the workings of the script. For the final version the "held_condition" field should be set to hidden. The initial question should also be set to "null" so that only the modified answer is saved.
Because this site won't allow the upload of js files, you'll have to copy the contents of the .txt document into a js function called "Replacefunctions.js".
That's an awesome idea, @LaurenceTait , thank you for sharing your wisdom! 🙂
I appreciate all your help! I am still working on making this all make sense. Below is what I have currently and its no working right now. If you see anything thats wrong please let me know! If you need anything further from me or have any follow up questions please let me know!! I really appreciate it!
There is a minor glitch in your code at Line 10. Should be const issuesString = issues.join (', '); and you have const issuesString = issues.join ('', ' '); But that won't stop it from working.
What do you mean when you say it's not working? Are you getting an error message in the script compiler, or when you save the xlsx sheet, or something else"
What happens when you test your code? Click the "fx" button on the scripts page, then copy in one or two of your choices from the worksheet, separated by a comma ",". Then click the execute button ">".
I've tried to replicate the sheet and code that you are using, and it works fine. I've attached the files below. Try those and see if you can get them to work, then you can use that as the basis for your own suvey.
If you upload your xlsx sheet and your js code, I'll try it at my end and see if it works. That might be the fastest option.
Cheers.
Sorry for the confusion, when I say its not working - When I go to my Pole Issues list and click another from the select multiple, it is not unselecting the "No Issue" that is defaulted. Hope this clears up what I mean. I attached the xlsx and .js below.
Two minor problems.
You have the [relevant] field for [held_condition] set to “false". Any field that is not relevant has the value set to null, so the held condition field can never store any values.
The other problem is that you have only added the first 4 of your 11 issues to your javascript finction, so the function will only work if you select one of those 4. Add all 11 to the function and it will work fine.
Hi AllHoping that this can help me with my current objective- not exactly like this, but I think I can use the js for this purpose with a bit of your help.I have a multiple select and when user selects their choices, they're stored as comma delimited values.How to go in there and separate them so that they may be used as individual fields for reporting purposes?
Also- how do i make the select multiple default to "all of them selected" -- usually the user will need to select all of them-Thanks so much.
Unless you have a huge number of choices, if you want to split the answers in the survey then the easiest way is just to to create fields for each possible answer and populate the field if the answer is selected.
Setting the response to all selected is done exactly the same way as setting the fault to a single answer, but with commas between the answers.
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.