Servicenow array string I used a FOR EACH loop in the flow designer to cycle through the array. in Developer forum 3 weeks ago; String array in flow designer in Developer forum 4 weeks ago I have created a simple subflow with an input type of array. . It looks like you're facing an issue with the order of query parameters in your request string versus the string you're using to generate the hash for the signature. var newStr = "Hello Servicenow user Chinmayee Mishra. Is there a way to instead query the entire MRVS array for a string, so that it returns TRUE if the string is found on any row and FALSE if the string is not found any any row? Solved! Go to ServiceNow Learn more about ServiceNow products and solutions. toString(); const str2 = JSON. ServiceNow Learn more about ServiceNow products and solutions. 2. Thanks, John Documentation Find detailed info about ServiceNow products, apps, features, and releases. Support Manage your instances, gives an array of 3 elements ['String 1 Part 1', 'String 1 Part 2, 'String 2'] but I would like only 2 elements . I'd like to take that list of groups and post it Like Andrew said, in your custom Action Outputs, the variable type in String. in Virtual Agent forum Wednesday; Documentation Find detailed info about ServiceNow products, apps, features, and releases. ; Impact Drive a faster ROI and amplify your expertise with ServiceNow Impact. Since ServiceNow is only capable of returning a string, it's is now necessary to convert object to string in Script Include so the original script will become like below as others have already replied. toString()); Please mark this correct & helpful if it answered your question. Support Manage your instances, access self-help, Converting a String to an Array. Thanks! 08-20-2019 10:37 AM. One way to do that with your existing code is to use the array method . Expected/Correct output format which i am getting in Background script: Hi, I have a string such as. For example, you could use a string variable and store the array as a JSON string. // Access each value Loading Loading Using split (" ") works for me. The main problem here is memory usage. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. Client Side: parse the array itterate and use the resulting Object: This version of the code gets me the Object and doesn't cause any JavaScript errors, but the resulting value comes back as 'undefined' you are sending the array to script include from client script. Solved: Hello, I want to map the value from the json array to string variable. 0 Helpfuls Reply. And the resolution suggested is to - Create a custom action that uses a string as the input, parse the string into an array, then outputs the array to be used in the For Loop. join() to create a string where all your array elements (task numbers) are joined by a new line character: outputs. Hi, I have a string such as. string datapill from the AD look up. In script include again you are converting to array using toString() and again converting it Solved: Hello, I want to map the value from the json array to string variable. For example - You can convert an array to a string like this(on the client side) : ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. So, when you go to print out your array, all objects point to the same user. Creates an array of equal length strings. Turn Object into string and then doing iteration: Server Side: using stringify to convert array to string. object or JSON , please change and take input type as a string You can Change data type in json format inside the custom script. Object and Array. Partner Grow your business with promotions, news, and marketing tools. I have a requirement to set incident fields short description, on behalf of and state from an array containing string values. Load more replies Post Reply Documentation Find detailed info about ServiceNow products, apps, features, and releases. // Replace with the actual field name that contains the Base64 string // Decode the base64 string into a byte array var base64Bytes = GlideStringUtil. Hi all, I have this array of objects, and i have to take the first object that have property 'userId' as a number. stringify(arrayName); // Pre-Helinki. items[0]. com , test3@example. Thanks! 0 Helpfuls Reply. As already suggested by Ankur you need to remove . tasklist = taskNumbers. Although pushing the string into the array works for while there is only 1 value in the session data (getClusters) when there is more than 1 sys_id in that string it pushes the whole string in. ×Sorry to interrupt. push (), it replaces all values in the array object with the last value pushed. From there, I am obtaining each companies’ sub-queues (u_phone_queue) string field which is listed in a comma separated list. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. // Helsinki. I've developed an Action that obtains chat data from MS teams, I've managed to parse the message content into an Object Array, and parse this out as an output variable to flow designer. Learning Build your skills with instructor-led and { // First, parse the JSON string into an array of objects var response = JSON. I want to calculate the difference between the 2 strings . You can adjust the separator parameter of the split () /**Checks whether a given string contains any of the values in a specified array or comma-separated list. forEach() or a standard for loop to loop over an array instead. Vi vil gjerne vise deg en beskrivelse her, men området du ser på lar oss ikke gjøre det. What mark posted is also You can use the . Object instead you can use Array. But that gives me an idea that potentially the AD look up is incorrectly classifying the member of output as an array. log(response); // This will now show the actual array of objects // Looping through the array using a for This comes in the form of a comma separated string. parseLineToArray(String cvsLine, String delimiter, String quoteCharacter) Parses passed in CSV formatted content into an array. string: Is this type not an array of strings? Perhaps I'm misunderstanding it or forgetting something obvious. Let's call this field okta_roles. stringify(array); // convert array to string }, type: 'TASK_return_array_SI' }); Since ServiceNow Learn more about ServiceNow products and solutions. Please note: The APIs below are intended for scoped applications and may behave differently Hi all, I'm thinking this should be a pretty simple solution but I'm not finding it. To overcome this issue you should use var str = array Hi all, I'm thinking this should be a pretty simple solution but I'm not finding it. But it didn`t work well. I want to write each message to the notes in the trigger incident however I cannot seem to get the flow to instant ServiceNow Learn more about ServiceNow products and solutions. I have 2 strings which contains comma separated sysid values. And in each if condition I change the reference to the array element (Array_A[1], Array_A[2] and so on). if the number of items in the array was not always the same etc. I am trying to acheive this using the diff function in the ArrayUtil. How do I do it ? Since ServiceNow is only capable of returning a string, it's is now necessary to convert object to string in Script Include so the original script will become like below as others have already replied. I'd like to take that list of groups and post it as a comment on a SCTASK. If setting variable "output" as a Array. split() method will do that for you without doing anything further. where user is selecting different departments and once the request item ticket is raise approval has to go Thank you for your reply. parse(response); console. Documentation Find detailed info about ServiceNow products, apps, features, and releases. Solved: Hi Friends, We have one custom table where we have string fields that we would like to convert into Integer fields. Object in question. Consider the difference: const arr = ["some", "cool", "array"]; const str1 = arr. It is Documentation Find detailed info about ServiceNow products, apps, features, and releases. They provide a way to store multiple values in a single The DynamicTranslation API provides methods that translate text, in real time, into multiple languages using translation service providers. All // where items is the array and [0] denotes the first index of the array obj. String cannot map, even if you add item under the Array element either directly as String or another object, still not able to map it. Here are some things that can cause performance issues when working with arrays (or ServiceNow Javascript code in general): Creating unnecessarily large arrays or strings. Hi All, As described in the example on servicenow docs I have created a UI macro for a custom interactive filter for a string field as below : In the example after this it says to create a custom dashboard object where we will pass the name of this UI Macro but I am unable to see the custom dashboard object in the application menu neither in my personal instance nor in my ServiceNow Learn more about ServiceNow products and solutions. This is why it's often important to be specific with what type you're using: In this case, you want the sysid (a string) so toString() works, a String() wrapper works, etc. unique() method of ArrayUtil accepts and filter Array of Strings only. split(" "); // Split on You could do a for-loop to iterate over and get elements from the array like so: var i; for (i = 0; i < fruitz. Hi All, I have a column EmailTo which contains comma separated emailids. goal is to limit input to 10 characters for each string value. When I add the field to the form it is treated like a single string field. So we cannot use the 'For Each' action directly in your flow. // Split the address_attribute string into an array var addressComponents = addressAttribute. With that said, it seems like you want to filter your array. Please tell me on how to solve this . stringify() method to convert an array to a JSON string. 3. Solved: Hi Team, I am getting response in Json then I am converting into string. Any advice would be helpful. Learning Build skills with instructor-led and online training. Belwo are the use case scenarios to explore each and every method of ArrayUtil in ServiceNow: 1. The events array may have 7 objects in it and the target array may have 2 objects for an event object which is at index 3 in events array, the loop will run for the 3rd time it will try to access the target[3] here the script will crash due to accessing an index which is beyond array's current indexes. Resolution: So here is a workaround. var str = "Hello Servicenow user Chinmayee Mishra. 1 Helpful Reply. Use JSON. To change type in Outputs, you'll need to click on "Edit Outputs" first. split(','); // "answer" is a comma seperated string for (var i Documentation Find detailed info about ServiceNow products, apps, features, and releases. Thanks & Regards, Sharjeel ServiceNow Learn more about ServiceNow products and solutions. Check out this: gs. Issue: When i run the code in Background Script it gives proper output but when i use same code in Actions it doesn't. E. There are also a few that aren't available and only work with ES6 (like array. in loop is used to loop over an object's properties, so a for. I created a custom action to turn that comma separated string in to an array. Some users are only in 1 group, so the JSON looks like this. CHECK IF ARRAY CONTAINS THE REQUIRED VALUE. Impact Accelerate ROI and amplify your expertise. // Used as a workaround to the Flow/Array. subflow_inputs. Try with following code. Removing Duplicates from an Array Solved: I have a string array that I would like to pass to a list collector variable . stringify(array); // convert array to Documentation Find detailed info about ServiceNow products, apps, features, and releases. For example, I am passing an array to Script include function as a parameter as below wh ServiceNow Learn more about ServiceNow products and solutions. This would work fine to print out the values, but it still only creates an array of incident numbers stored as strings. Learning Build your skills with instructor-led and online training. Hi @gunishi ,. So that I could then do something like below, for instance to get the company name referenced on one of the incidents in the array: Hi @gunishi ,. For example - You can convert an array to a string like this(on the client side) : Documentation Find detailed info about ServiceNow products, apps, features, and releases. Since the order of parameters matters for generating a valid OAuth signature, you'll need to ensure that both the request string and the hash string use the same order. You can define a REST API endpoint by creating a Scripted REST API in ServiceNow, which allows you to define the URL, HTTP method, request and response formats, and the script that handles the request. split () method to separate the string and convert it into an array, making it easier to apply a loop with the array. A string can Documentation Find detailed info about ServiceNow products, apps, features, and releases. push(gr. Consider the following sample script to fetch all the open P1 To convert a string to an array in ServiceNow server-side script, you can use the split () method. String which will accept all the values in a string format. How do I split this string every three digits and add a comma to separate? Documentation Find detailed info about ServiceNow products, apps, features, and releases. Draggi ServiceNow Learn more about ServiceNow products and solutions. split (','); // split method returns an array. Create a Text Field: First, create a text field on the User form in ServiceNow where you want to store the roles. string when it should be an array. For example: ServiceNow Learn more about ServiceNow products and solutions. Support Manage your instances, access self-help, Retrieve the string preceding the @ from the array list's email ID. string field ("Drag and drop approvers' list here") to input the list from the flow, then retrieve it in the subflow as a comma-separated string like this: fd_data. What I am trying to do is to store an array of incident objects. I even tried to match the sys_id instead of the name field. '); Here I look at 3 of those methods: contains (Array array, Object element) Searches the array for the specified element. You can use any delimiter. The Devvies 2025 are here! Celebrate your hard work and innovation by submitting your apps today. The comma seperated string I'm getting the first value I'm using to set another reference field field so how can I remove that and also the list collector field called co-owners . g. When the convert array action input is changed from an array. However, I am having a hard time. e. Partner Grow your business with promotions, news, and marketing tools for partners. You need to join the array first in LineNumber 22 current. How do I do it ? Documentation Find detailed info about ServiceNow products, apps, features, and releases. Hi @SM16 , I trust you are doing good. I have same query on this. I need to create a script that will separate them with commas every three digits. Returns the element index or -1 if not found. For example - You can convert an array to a string like this(on the client side) : var arr = [["A", "1 There is a HI reference which mentions that The Get Catalog Variables action returns a list collector as a comma separated string rather than an array. I'm attatching the screenshots of Client script, script include and the output here. View solution in original post. To build an endpoint that accepts JSON array with filters, you can use ServiceNow's REST API capabilities. split(','); // Assuming the address components are ordered as: Street, State, City, Zip, Office ServiceNow Learn more about ServiceNow products and solutions. Join the excitement! ServiceNow Learn more about ServiceNow products and solutions. in loop to access its indexes. Expected/Correct output format which i am getting in Background script: Documentation Find detailed info about ServiceNow products, apps, features, and releases. string to an array. Impact Drive a faster ROI and amplify your expertise with ServiceNow Impact. string output. 0 Helpfuls unique() method of ArrayUtil accepts and filter Array of Strings only. The Devvies 2025 are here! ServiceNow Learn more about ServiceNow products and solutions. * @param listOfValuesToCheckFor {object|string} An array or comma separated string, containing a list of strings to check. where user is selecting different departments and once the request item ticket is raise approval has to go ServiceNow Learn more about ServiceNow products and solutions. Please note: These APIs are provided to support legacy applications in the global scope. Learning Build your skills with instructor-led // Match any character (. A simple way would be to split the string into an array at the comma, for example: currentsub_profile = 'Traditional User, Jane Doe - Special User, Bob Williams - Heavy Traveler', something like this would work: var string = currentsub_profile. I'm getting comma seperated String of sys_id. split(',')[0]; //this returns "Traditional User" You can also achieve this by using regular expression: Trying to take a string field that accepts multiple values, push into an array, and get the first 10 characters of each value and write the values back to the field. Learning Build your skills with instructor-led For some users more than one department comes through and these numbers come through as one long string (310245610). Object, just don't stringify the resultArray. Only getting the the first 10 characters of the entire string not the first 10 of each number in the array. Learning Build your skills with instructor-led and // Logs the array string of sys_ids // Return the list as a JSON string return 'sys_idIN' + userList. ; Store Download certified apps and integrations that complement ServiceNow. Click here to see the wiki article on this. approvers_list[0]. If all you're trying to do is convert a comma separated list of strings to an array, the Javascript . I have a string array that I would like to pass to a list collector variable. recipients. Then, when you want to work with that comma-separated string, you can make use of a custom flow action, that takes in a string, and outputs an array of strings, making use of the split(",") function in the script. Change type to Array. Then retest your flow. (String regex, int limit) which returns a Java array. So if you use var itemString = String(item); the itemString will always be a JavaScript String which should make coding easier. CSS Error You can use indexOf function to check whether a value is present in the array of not. You can use the JSON. GlideAjax is one of the most versatile scripting tools available to ServiceNow Administrators and Developers. log ServiceNow Learn more about ServiceNow products and solutions. The first one is createIterator, which is used to initialize a new iterator, and the second is iteratorNext, which will support the Action that you will invoke inside of your loop to get the next item in the Array. if the data type is object ,Array. Documentation Find detailed information about ServiceNow products, apps, features, and releases. In script, you can check if a string contains a specific substring using the indexOf() method or a regular expression. If any of these You need to encode your array in the script include and return a JSON string. This article dives into some of the array methods used in ServiceNow. In script include again you are converting to array using toString() and again converting it Hi Community, I need help in setting field values from an array containing strings. var list = g_form. You need to encode your array in the script include and return a JSON string. str = str. stringify() will convert the json object into a String. I then have a For each logic action so I can loop through this array of strings: And within the loop I'm simply attempting to print to the log: When I go to test I enter a Ok, here's what worked for me. In this example, we include the ability to accept fields that we want stored in the objects. For those array entries that are storing a value ‘ yes ’ is being selected in the if and the workflow proceed as expected; but for those that nothing was selected instead of an empty element (‘ ‘) I get ‘ undefined ’ and the if return ‘yes’ as well instead of ‘no’. How exactly we map this in JSON builder? Both Array. To acheive this , how to convert string to array? ServiceNow Learn more about ServiceNow products and solutions. watch_list expects string. getValu E. The problem I'm having is I will never know how long the string will be. com '}" What I am trying to get is the list of subscribers so I can update their email ids in the table. return JSON. split(","); // Split on commas txt. This way, when all items are removed from the array, the variable will still contain a JSON string and will not become null. indexOf(Array array, Object element, Number startIndex) Searches the array for the specified element starting at the specified index. I still find it rather odd that I cannot use the When the convert array action input is changed from an array. Here's an example code snippet that demonstrates how to convert a string to an array using the split() method in ServiceNow server-side script: Let’s see an example of a function whose purpose is to take a GlideRecord and return an array of objects for later use. I'm afraid I cannot share much (company policy) but I managed to use the child of the array. in loop on an array could potentially loop over non-indexes, which can cause you problems (more here). find()). The CSVParser API provides methods for parsing comma-separated value (CSV) formatted records into an object or an array. I decided to create a Flow Action to process the JSON payload in an attempt to extract that value from the Array. base64DecodeAsBytes(base64String); Hi Venkat, Thanks for the reply - thought it might have been something about strings & arrays but missed that amongst the original code. For example i want to take object {name: 'Mario',userId: '040287960321'}. join("\n"); Documentation Find detailed info about ServiceNow products, apps, features, and releases. var myArray = And in each if condition I change the reference to the array element (Array_A[1], Array_A[2] and so on). I tried creating an flow variable and used split string function but it is not taken by for To convert a string to an array in ServiceNow server-side script, you can use the split() method. The split() method splits a string into an array of substrings based on a specified separator. Here's how you can do it: Using indexOf(): You can use the indexOf() method to check if a string contains a specific substring. Learning Build your skills with instructor-led Documentation Find detailed info about ServiceNow products, apps, features, and releases. As per below image I want to fatch test id and it is giving me. watch_list = newWList. return new JSON(). ; Partner Grow your business with promotions, news, and marketing tools for partners. toString ()); Please mark as Correct Answer/Helpful, if applicable. com , test2@example. Geoff I've seen a couple of questions around working with arrays so I thought I'd write an article on some methods that are available to us in the system. info(fruitz[i] + ' is element number ' + i + ' in the array. directly to compare multiple string values in a single time. When you loop over an array, you shouldn't use a for. stringify(arr); This can be done by converting an object to a string, using a built in method, that is incredibly simple. The split () method. To acheive this , how to convert string to array? You can use indexOf function to check whether a value is present in the array of not. ticketId; You will want to know if this response data structure will always be the same mind you, otherwise you might need a more dynamic scripting solution i. A string can be converted to an array with the split() method: var txt = "a,b,c,d,e"; // String txt. base64DecodeAsBytes(base64String); Documentation Find detailed info about ServiceNow products, apps, features, and releases. Unfortunately it is only setting the last object in the array. encode(arrayName); In your client script, you parse the answer from the response like you normally would, but when you extract your array from the answer like this. 4. Store Download certified apps and integrations that complement ServiceNow. In addition, you can use this API to detect the Loading. object, then the action doesn't allow me to use the array. -1 refers value not present Refer sample script var ciArr = ServiceNow Learn more about ServiceNow products and solutions. Afterwards, the sub-queues should be split up and populated into an array, where they a Solved: Hello, I want to map the value from the json array to string variable. I want to separate them in to an array of email ids and loop them through for loop. How can I make it populate the entire array? Script: var seperate = answer. outputs. Remember in Javascript a string can be mis-interpreted as an array because bracket notation can be used on a string. I don't know everything so if you see any errors or places that I have 2 strings which contains comma separated sysid values. How do I do it ? I have same query on this. toString(). we discussed a basic example of how to use GlideAjax to retrieve a single String value rather than retrieving the entire GlideRecord object. join(','); // Joins strings back together separated by a comma. An array doesn't contain any of the formatting information, so instead you should form a string. See demos and learn more about the Xanadu release, ServiceNow Learn more about ServiceNow products and solutions. Returns true if the element exists in the array, otherwise Dot walking to an Array. Object value extraction issue we ran into // inputs: the JSON payload // JSON Parser step: us Reason -> The Get Catalog Variables action returns a list collector as a comma separated string rather than an array. Scenario: I am designing a Action in Flow designer where through scripting i need to pass some array of string value. Check out this boatload of useful ServiceNow code snippets, to help you quickly and easily do a great many things on the The string to check against the list of values to check for. User user ID is : 1234s" ; I have to find the ID and replace with another ID , lets say. String and using that output as input to other steps will cause issues whenever the plan needs to serialize and deserialize at a later point Steps to Reproduce 1. Object. You can use any of the below scripts in a background script, to test it out. Convert Array to JSON String: Before storing the array data, you need to convert it into a JSON string. Converting a String to an Array. Thanks & Regards, Sharjeel I have a string array that I would like to pass to a list collector variable. to do this I would like to do a while-loop and use regex, so that it returns me the first object that passes the regex test, but I don't know how to do it. Solved! It looks like you have a value as a string but need to have multiple values instead. base64DecodeAsBytes(base64String); ServiceNow Learn more about ServiceNow products and solutions. I am trying to write a fix script for copy data from a string field to interger field, can you please help with the function which is used to convert. You need to change that to Array. I'm using the Active Directory v2 spoke to get the list of groups that a user is a member of. I tried creating an flow variable and used split string function but it is not taken by for ServiceNow Learn more about ServiceNow products and solutions. What I tried is to make Action in #2"For Each" to look at the #1 table, and tried to convert the List to Array. * @param listOfValuesToCheckFor Turns out, the reason is that ServiceNow overrides the JavaScript default Array class, and the methods thereof, including indexOf(). The Java Virtual Machine that ServiceNow runs in has 2GB of memory total. To change, click on the "Outputs" at the left hand side. Hi @marketa_w Please check your input data type in the subflow. split() while pushing data into the array so that it should be Array of strings. JSON. Your user ID is : 987c"; The string length is not constant as the names can be different. print ("Array element:"+userDetails. (contains split), which splits the string and creates an array and then again in next iteration, it tries to split the undefined/null object which might cause the problem. I wrote each department name in to a string called departments. Arrays are one of the most commonly used data structures in JavaScript, and they are also prevalent in ServiceNow scripting. you are sending the array to script include from client script. If it's a string that looks like an array ( "[sys_id1,sys_id2]" ) the results to str[0] will be completely different than a real array that contains sys_ids as strings or variables (["sys_id1","sys_id2"] or [sys_id1, sys_id2]). join(','); // Convert to array string and return it } var items = gs. For the list type field you don't have to use Array. stringify(), not Array. CSVParser. Object using Expand Script of #3"Set Flow Variables". -1 refers value not present Refer sample script var ciArr = ServiceNow Learn more I created an array (allQueues) which lists some companies from the core_company table. i added that departments string to the story record where I wanted it I am trying to write a fix script for copy data from a string field to interger field, can you please help with the function which is used to convert. Example: var arr=["servicenow,community"]; I have an array like this but i need the array as var arr=["servicenow","community"]; via server script. length; i++) { gs. First encode this Array as a string, and pass it. I have no problem manipulating arrays in javascript and elsewhere but the arrays were always fields in the database. Use . output = resultArray; 0 Basically, there are two methods, one for each of the two Flow Designer Actions that I intend to build. Please suggest , if this. They provide a way to store multiple values in a single variable, making it easier to handle and manipulate data sets. I don't know everything so if you see any errors or places that Documentation Find detailed info about ServiceNow products, apps, features, and releases. Go to solution. getProperty ('hidden_req_for_ref_qual_item_ids Actually, I will need several array fields on the form for manual entry. This API runs in the sn_impex namespace. * @param stringToCheck {string} The string to check against the list of values to check for. This string can't be used in a for each loop, so I created a custom action to parse the JSON string. String. Here is my rather imperfect solution. Create a custom flow action that takes list collector value string as the input; Parse the string into an array You can use the JSONParser Script Include to parse JSON strings - see JSONParser - ServiceNow Wiki for more details. ArrayUtil - Global. Like Andrew said, in your custom Action Outputs, the variable type in String. join(','); gs. String and then "Save" and "Publish". If the method returns a value greater than or equal to 0, it means the substring is present in the string. I converted the array to a string, and with the numbers of the changes, I also passed the following text to the ui page: ^NQnumberSTARTSWITH. The lookup is working and I retrieve the user's memberof groups in a JSON String. This will give you the array that you can then run through a Hi All, I have a column EmailTo which contains comma separated emailids. That returns an array. Learning Build your skills with instructor-led and online I had thought since I converted the values in the array to string already, this would not be required but I added your fix to where it matters and it is working straight away. So "output" should be a String instead of an Array. Hi All, As described in the example on servicenow docs I have created a UI macro for a custom interactive filter for a string field as below : In the example after this it says to create a custom dashboard object where we will pass the name of this UI Macro but I am unable to see the custom dashboard object in the application menu neither in my personal instance nor in my Vi vil gjerne vise deg en beskrivelse her, men området du ser på lar oss ikke gjøre det. Hello, Returning the list of names, you will have to concatenate at the start of string the field for your query, something like: //replacing line 12 with: return "nameIN"+strQuery; you can also return the sys_id's and return a string like: //replacing line 8 with: a1. Play with Arrays in ServiceNow (JavaScript) - Some methods in Developer articles Sunday; Dynamically Populate Select Box for General Users in Developer forum 2 weeks ago; Check whether the string has any value in the array. I hope this helps. object. I've seen a couple of questions around working with arrays so I thought I'd write an article on some methods that are available to us in the system. var myArray = Documentation Find detailed info about ServiceNow products, apps, features, and releases. Learning Build your skills I am trying to design flow inside a flow designer in which when a list collector field is given by converting into array of string . Both utilize an existing scratchpad, so you will need to create ServiceNow Learn more about ServiceNow products and solutions. For example, you'd want to pass a string that looks like this in your First encode this Array as a string, and pass it. /** * Converts a ServiceNow GlideRecord into an array of objects, with each object representing a record and its specified fields. } return JSON. ) up to 3 times ({1,3}). recep. Hi, I'm setting some values in catalog client script. A for. For example: The string is something like (it is an api response in string type) var text = "{"subscribersGroup": 'APJ', "subscribers": ' test1@example. however it's possible to convert an Array of Objects to JSON as well, *List column references 3 columns of type String. getValue ('list_collector'); var elements = list. Hi Pennie, current. MERGE TWO ARRAYS. I tried using array, object and string as well to return the value from the script include but still the same result. FIND WHAT ALL DISTINCT VALUE GIVEN Loading Loading When adding new values to an array object using Array. split(','); // "answer" is a comma seperated string for (var i ServiceNow Learn more about ServiceNow products and solutions.