- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2022 02:46 AM
Hi,
I have a requirement, in catalog form we have list collector field (will be displayed only on portal not in ritm and task) and in ritm and task we have single line text field (will not display in portal) while raising the request values selected in the list collector need to be populate in the single line text (ritm and task) ...how can we achieve it
Please help me with the full script
Thanks in Advance
Solved! Go to Solution.
- Labels:
-
ITSM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2022 04:06 AM
Hello,
Please use the below script:-
(function executeRule(current, previous /*null when async*/) {
current.variable.singlelinetextvariablename=current.variables.listcollectorvaribalename.getDisplayValue();
})(current, previous);
Please mark my answer as correct based on Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2022 03:29 AM
Hello,
Is the single line text a variable or a field?
If it is a field write the below code in the before insert BR:-
Condition:- Item is (select the item name)
(function executeRule(current, previous /*null when async*/) {
current.singlelinetextfieldname=current.variables.listcollectorvaribalename;
})(current, previous);
If it is a variable write the below code in the before insert BR:-
(function executeRule(current, previous /*null when async*/) {
current.variable.singlelinetextvariablename=current.variables.listcollectorvaribalename;
})(current, previous);
Please mark my answer as correct based on Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2022 03:55 AM
Hi Saurav,
It is a variable and i tried the BR but it is displaying its sys id not the name
How can we modify the script so that the value will be shown
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2022 04:06 AM
Hello,
Please use the below script:-
(function executeRule(current, previous /*null when async*/) {
current.variable.singlelinetextvariablename=current.variables.listcollectorvaribalename.getDisplayValue();
})(current, previous);
Please mark my answer as correct based on Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2022 04:19 AM
@suuriya Please try below code
ServiceNow Community Rising Star, Class of 2023