WHAT IS ARRAYUTIL API IN SERVICENOW ?
ServiceNow ArrayUtil API is a script include which contains useful functions through which we can directly perform some JavaScript Array logics instead of writing multiline code.
ArrayUtil methods are available to any server side script. Methods Like: concat(), unique(), union(), intersect(), ensureArray(), contains(), indexOf() etc.
Use Cases implemeted in this video related to ArrayUtil in servicenow:
1. MERGE TWO ARRAYS.
2. CHECK IF ARRAY CONTAINS THE REQUIRED VALUE.
3. FIND WHAT ALL DISTINCT VALUE GIVEN ARRAY CONTAINS IN COMPARISION TO OTHER AVAILABLE ARRAYS.
4. FIND OUT THE INDEX OR POSITION OF REQUIRED ELEMENT IN AN ARRAY.
5. FIND WHAT ALL ELEMENTS ARE COMMON IN ALL GIVEN ARRAYS
6. COMBINE ALL ARRAYS BUT, IT SHOULD ONLY CONTAIN UNIQUE VALUES.
7. FIND WHAT ALL UNIQUE VALUE A SINGLE ARRAY CONTAINS.
8. CONVERT JAVASCRIPT OBJECT TO JAVASCRIPT ARRAY.