You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Create removeFromList.js
Code to remove element from a list field
* Create readme.md
Add some documentation about the code, usage and community reference.
This script can be used to remove a specific element from a list field across multiple records in a table that match a query condition.
2
+
3
+
It requires 3 variables to be set:
4
+
- table {string}: the name of the table to run on, e.g. 'kb_knowledge_block'
5
+
- listField {string}: the name of the list field on the above table to remove an element from, e.g. 'can_read_user_criteria'
6
+
- whatToRemove {sysId}: the sys_id of the element to remove from the list field, e.g. sys_id of a specific user critria
7
+
8
+
The script contains additional inline comments about what it does while runnning.
9
+
10
+
Further context annd use case can be read in the [related community post](https://www.servicenow.com/community/developer-forum/glide-list-type-field-need-to-remove-one-value-in-bulk/m-p/2431257#M947276) where this code was used as the solution by yours truly.
0 commit comments