setValue API used with list collector variable in portal and too much data

kc1959
Tera Contributor

Hello,

I think I'm hitting the issue that is described here:

In Service Portal, g_form.setValue does not work in List Collector variables when displaying large d...

- I have a 'users' list collector variable where we want to limit the number of selected users should be restricted to 50. So I have an 'onChange' client script that:

  • copies the new value of the list collector into an array
  • counts the number of users added
  • if > 50 then remove the last entry in the array
  • set the value of the list collector to the new array value (now containing 50 user sys_ids) using g_form.setValue

This isn't working and it looks like setValue is limited to around 30 sys_ids.

I've tried setting the variable attribute to glide_list as suggested in the above support article but it is still clearing the field instead of redisplaying the 50 users.

Has anyone seen this issue or can suggest a workaround?

Many thanks in advance.

 

 

3 REPLIES 3

Anil Lande
Kilo Patron

Hi,

Gave you added glide_list attribute on Variable configuration?

https://docs.servicenow.com/bundle/orlando-it-service-management/page/product/service-catalog-manage...

 

Thanks,

Anil Lande

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

Anil Lande
Kilo Patron

Hi,

I tried g_form.setValue() in onLoad Client Script and added 60 users by hardcoding sys_id's. It worked for me.

find_real_file.png

 

Thanks,
Anil Lande

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

I'm also facing this issue. g_form.setValue() works perfectly fine in Native UI but doesn't work in Service Portal even after setting glide_list attribute to true in the catalog item variable.

@kc1959 were you able to fix this?