- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā01-01-2022 11:06 AM
Hello,
I am new to ServiceNow, and I am trying to solve this task. So far, everything is going well the only point I cannot implement.
The workflow assigned to this catalogue item should print out a log in the system logs to say "User <name of the user> has ordered more <phone or tablet> for server <server name>". It should be written also in the Work Notes field of the Requested Item. Set the state of the RITM to Closed complete after writing the messages in the previous step.
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā01-04-2022 05:51 AM
Hi John,
Glad to connect and your issue was Resolved. Please mark my answer as correct and close this thread.
Same as below thread:
https://community.servicenow.com/community?id=community_question&sys_id=d9d6c24d1bf40d94d01143f6fe4bcbeb
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā01-01-2022 11:21 AM
Hello John
To add work notes via script, you can use below syntax:(you can use run script in workflow to add this)
current.work_notes = "User <name of the user> has ordered more <phone or tablet> for server <server name>"
To add system log, you can refer below syntax:
gs.log('User <name of the user> has ordered more <phone or tablet> for server <server name>');
for <name of the user>, <phone or tablet>, <server name> use backend names of fields to add.
you can configure it by concating your string like below:
current.work_notes = 'User'+userBackendFieldName+' has ordered more'+ 'phoneortabletBackendFieldName+' for server'+BackendFieldNameservername
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā01-01-2022 12:38 PM
Hello Prasad,
Thank you for your suggestion. I have a question though how can I receive their backend names? I mean I know the variable name usually is in design form. Is it the same for the backend part?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā01-01-2022 12:49 PM
You can track down the backend names of variables by following ways:
1 way)
Go to maintain items > open catalog item > variables
way 2)
Right Click on variable on form > Configure Variable
The script I provided above is to access FIELDS.
In your case you have variables so please use below syntax to access variable in workflow:
current.variables.variable_name
Your script will look like this:
current.work_notes = 'User'+ current.variables.variable_name +' has ordered more'+ 'current.variables.variable_name+' for server'+current.variables.variable_name
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā01-01-2022 01:09 PM
Okay, so first I try to test the workflow with the new string which I created for the requested item, and it does not work yet.
I am attaching some screenshots for a better grasp of my issue.
workflow
catalogue item
request
requested item