Skip to main content
Known Participant
Jan 22, 2026 2:52 PM UTC
Solved

getting error in Multiple dropdown field.

Hi Team,

Below is my code snippet, i hope i have handled the null but still am getting. can you please guide where it went wrong.

local!salesReps:index(rule!GSE_SCL_QRY_getViewIntakeDetails(
region:local!region,
sipYear:local!year,
pagingInfo:a!pagingInfo(1,-1)
).data,"Name",null),
local!repChoice:{union(local!salesReps,local!salesReps)},
local!salesRepName: if(a!isNullOrEmpty(local!repChoice),"None","All reps"),

a!multipleDropdownField(
label:"Sales rep name",
choiceLabels: if(a!isNullOrEmpty(local!repChoice),
{"No reps"},
{"All reps",local!repChoice},
),
choiceValues: if(a!isNullOrEmpty(local!repChoice),
{"None"},
{"All reps",local!repChoice},
),
value:local!salesRepName,
saveInto: local!salesRepName
)

harshm4411
Participating Frequently
Jan 22, 2026 4:25 PM UTC

Can take reference from this code: 

a!localVariables(
   /*----- reject function will remove null values from the list ----------*/
local!salesReps:reject(fn!isnull,{"A","B","C",null}),
local!repChoice:{union(local!salesReps,local!salesReps)},
local!salesRepName: if(a!isNullOrEmpty(local!repChoice),"None","All reps"),

a!multipleDropdownField(
  label:"Sales rep name",
  choiceLabels: if(a!isNullOrEmpty(local!repChoice),
  {"No reps"},
  {"All reps",local!repChoice},
  ),
  choiceValues: if(a!isNullOrEmpty(local!repChoice),
  {"None"},
  {"All reps",local!repChoice},
  ),
  value:local!salesRepName,
  saveInto: local!salesRepName
)
)

4 replies

harshm4411
Participating Frequently
Jan 22, 2026 4:14 PM UTC

Hi [mention:eb1eb969d9fb4b92b282820e0b70ee27:e9ed411860ed4f2ba0265705b8793d05] , 
In the given code, I noticed that the local variables you created are not wrapped inside the localVariable() function. Additionally, the local variable: salesReps contains null values, which is causing an error. Please add proper null handling and check this after making the changes.

harshm4411
Participating Frequently
Jan 22, 2026 4:25 PM UTC

Can take reference from this code: 

a!localVariables(
   /*----- reject function will remove null values from the list ----------*/
local!salesReps:reject(fn!isnull,{"A","B","C",null}),
local!repChoice:{union(local!salesReps,local!salesReps)},
local!salesRepName: if(a!isNullOrEmpty(local!repChoice),"None","All reps"),

a!multipleDropdownField(
  label:"Sales rep name",
  choiceLabels: if(a!isNullOrEmpty(local!repChoice),
  {"No reps"},
  {"All reps",local!repChoice},
  ),
  choiceValues: if(a!isNullOrEmpty(local!repChoice),
  {"None"},
  {"All reps",local!repChoice},
  ),
  value:local!salesRepName,
  saveInto: local!salesRepName
)
)

Known Participant
Jan 23, 2026 11:48 AM UTC

thank you it works

Participating Frequently
Jan 23, 2026 4:01 AM UTC

[mention:eb1eb969d9fb4b92b282820e0b70ee27:e9ed411860ed4f2ba0265705b8793d05]  Choice values cannot be null, in the code you shared it's covering one of the scenarios where the whole GSE_SCL_QRY_getViewIntakeDetails returns no values. But some of the Name are null and causing the error. I would suggest to update  GSE_SCL_QRY_getViewIntakeDetails to filter out null names and or iterate thru the salesReps and remove nulls before using as choicevalues, I recommend former.