- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2014 06:10 AM
The script stops executing on a the line which contains the split and the log shows a message "split is not a function". What gives?
I've searched and found several examples where it appears to work for others. What am I missing?
Here's the pertinent part of the script ( which runs in a "Run Script" block as the first step in a workflow 😞
--- start script --
var list1 = current.variables.system
current.description = "location 1"; // for debugging purposes
var systemlist = list1.split(',');
current.description = "location 2"; // for debugging purposes
-- end script --
current.variables.system is a list collector type of variable.
When I submit the form, the description of the requested item shows "location 1". So I know we make it to the split, but not past it.
Any ideas?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2014 07:45 AM
I believe you need to feed your list into a string with this command
list1 = current.variables.system.toString();
instead of how you have it.. you are trying to split an array that is already split.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2014 07:45 AM
I believe you need to feed your list into a string with this command
list1 = current.variables.system.toString();
instead of how you have it.. you are trying to split an array that is already split.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2014 10:29 AM
This tip worked great! Thanks randnews!
This leads up to another issue, in that I get a bunch of sysids and not human readable names.
But that's another topic and I'm opening another disocussion on that point.
THANK YOU!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2014 10:42 AM
i believe adding .getDisplayValue() to the variable should give you the common name..
if not go into the dictionary for the field you want to be the display value and set that as display true <be aware each table can have one and only one display value>