- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-04-2017 07:19 AM
In fulfiller workflow script, I am getting a multi text variable called get_name that array is assigned to in catalog client script. Here is what multi text variable looks like,
After submitted, In workflow script, gs.log(getList); is showing exactly log result as multi text box above,
However it seem when I try to use var lines = getList.split(','); to split members using comma and test it using log again but it not printing anything and sometime I get undefined. What is wrong with my code? Why getList is able to get string values but not lines variable? Here my sample codes,
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-04-2017 08:04 AM
Hi Bradley,
Can you try toString() and give it a try?
var lines = getList.toString().split(',');
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-04-2017 07:44 AM
Hi Bradley,
Can you please define the variable 'getList' as var getList = current.variables.get_name; instead of what is now and give it a try?
hope this helps. Please mark correct/helpful based on impact
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-04-2017 08:10 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-20-2020 02:38 AM