- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2018 07:44 PM
Hello im a complete newcomer with servicenow and im trying to lear it.
My goal its to create a workflow to add a user(sys_user) to use it in a form in a Catalog item.
I create one workflow to test it but when i go to my catalog item it doens show up in the list of workflow.
Any form to test workflows?
how do i access to the data of the catalog item form to insert it into sys_user table?
how do i insert data in table via workflow scrips.
Thanks so much for you help.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2018 01:46 PM
In a workflow script activity, you can access catalogue variables via:
current.variables.<variable_name>
If you want to insert a record into sys_user, you'd need to use a GlideRecord query to insert the data. Start here for a great rundown of GlideRecord:
Something like this may work:
var userGr = new GlideRecord("sys_user");
userGr.initialize();
userGr.user_name = current.variables.userName;
userGr.first_name = current.variables.firstName;
userGr.last_name = current.variable.lastName;
userGr.insert();
Hope that gets you started!
Tim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2018 01:46 PM
In a workflow script activity, you can access catalogue variables via:
current.variables.<variable_name>
If you want to insert a record into sys_user, you'd need to use a GlideRecord query to insert the data. Start here for a great rundown of GlideRecord:
Something like this may work:
var userGr = new GlideRecord("sys_user");
userGr.initialize();
userGr.user_name = current.variables.userName;
userGr.first_name = current.variables.firstName;
userGr.last_name = current.variable.lastName;
userGr.insert();
Hope that gets you started!
Tim