Mobile Input - MultiSelect input field didn't work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2025 10:45 AM - edited 01-23-2025 10:50 AM
Hello,
I created a personalized field (Necessidades - u_pecas_necessarias) in the Work Order Task Form, that is a List type field.
In that field, I insert some entitlements from a specific contract.
I need that field in mobile, so the agent assigned to the WOT, can insert some "Necessidades" (in this context, requirements, in portuguese). In this field, the agent must be able to select multiple records, so I created a form input, that is shown next.
Photo of the input configuration:
I'm having a trouble in the configuration of a input for this field in the following point: when I try to update some records, it doesn't update. Watching some logs that I've inserted into the script include that updates the record, it was possible to see that when the attribute "MultiSelect" to "true" on the input shown in the screenshot above, it doesn't receive any information about the input "pecas_necessarias":
- Log when "MultiSelect" = true
However, I changed "MultiSelect" to "false" (just for test effects, in the business requirement I need multiple records), and the problem stops:
- Log when "MultiSelect" = false
This error doesn't affect the ServiceNow Plataform on Desktop, just the Agent Mobile App.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2025 07:45 AM
When MultiSelect is true, parm_input.pecas_necessarias is a Java ArrayList of Strings (not converted to JavaScript array).
To print out the multi selected values in your script include, you can try with
gs.info("multiselected values length: " + parm_input.pecas_necessarias.length)
and
gs.info("multiselected value 0: " + parm_input.pecas_necessarias[0])
etc.