- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-17-2019 08:21 PM
I have a script, and script include that I have found on the forum, and works well (many thanks). The requirement is to take the values from a list collector, and display them in a multi line text variable.
The results are being displayed on one line, no spaces, and comma separated. I would like each value on a new line. I have tried without success to add \n ( or is it /n) after the split. But nothing seems to work?
here is the client script, and script include, any suggestions welcome. Appreciate all replies, thanks, Mark S.
|
function onChange(control, oldValue, newValue, isLoading, isTemplate) { //Values that have been added var getNames = new GlideAjax('getChangedValueNames'); function getAnswer(answer) { function fieldValueCheck(array1, array2) { return rtnArr; |
| var getChangedValueNames = Class.create(); getChangedValueNames.prototype = Object.extendsObject(AbstractAjaxProcessor, { getNames: function(){ var newValues = this._getRecords(this.getParameter('addedValue')); //var oldValues = this._getRecords(this.getParameter('removedValue')); var rtnObj = { addedValue:newValues, //removedValue:oldValues }; var rtnStng = JSON.stringify(rtnObj); return rtnStng; }, _getRecords: function(arrayList){ //Change 'sys_user' to the table you are refencing in your field var rtnArr = []; var record = new GlideRecord('sys_user'); record.addEncodedQuery('sys_idIN' + arrayList); record.query(); while(record.next()){ rtnArr.push(record.name.toString()); } return rtnArr + ''; }, type: 'getChangedValueNames' }); |
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-17-2019 08:54 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-17-2019 08:54 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-17-2019 10:27 PM
Thank you John, that worked a treat. I should have looked the script include. Have a great week.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2021 03:29 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2021 02:18 PM
