Mobile Input - MultiSelect input field didn't work

Gustavo Sales
Tera Contributor

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:

GustavoSales_0-1737656841089.png

 

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":

 

GustavoSales_1-1737657534975.png   - 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:

 

GustavoSales_2-1737657696851.png - Log when "MultiSelect" = false

 

 

 

Spoiler
In conclusion, I'm searching for a solution where I can see the records when "MultiSelect" = true.

This error doesn't affect the ServiceNow Plataform on Desktop, just the Agent Mobile App.

 

 

1 REPLY 1

Mike Deng
ServiceNow Employee
ServiceNow Employee

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.