- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2015 02:04 AM
Hi All,
Thanks for reading this.
I want to pass variable value from workflow event activity to Script action for processing and getting the dynamic values for the my code.
for example: (Assumned that i have one variable in item)While Event activity occurs in the workflow,it call the script action script(Now i am using static data to process).Now i want to send the dynamic variable values to script action.
And how to set that passed varibale value in the below URL.
in the above URL the 10.180.100.0 is the static value. i want replace that value with my variable value.
I hope i made it clear here.
Please help me to resolve.
Thanks in Advence.
Thanks,
Veeresh
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2015 05:19 AM
From your 'Create Event' activity, select your event name in the reference field. You can pass your catalog variable to your script action using either Parameter 1 or Parameter 2 - simply insert JavasScript into those fields to make it dynamic: ${workflow.variables.yourVariableName}
As for appending the parameter value to the URL you posted above - simply concatenate the strings: var myURL = 'https://dhcp-manager.net.hban.us/wapi/v1.4.1/ipv4address?network=10.180.100.0/27&ip_address=' + yourParameter;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2015 05:19 AM
From your 'Create Event' activity, select your event name in the reference field. You can pass your catalog variable to your script action using either Parameter 1 or Parameter 2 - simply insert JavasScript into those fields to make it dynamic: ${workflow.variables.yourVariableName}
As for appending the parameter value to the URL you posted above - simply concatenate the strings: var myURL = 'https://dhcp-manager.net.hban.us/wapi/v1.4.1/ipv4address?network=10.180.100.0/27&ip_address=' + yourParameter;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2015 05:20 AM
Oh yeah - you can access parameters from your script action with the following syntax:
event.parm1
event.parm2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2016 10:37 AM
Can this be put into my notification? I want to refer to a REQ from a notification email, fired off of an event in a catalog item workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2016 11:06 AM
If you're firing your notification from an event, you should have access to both event.parm1 and event.parm2 from your Email Notification script - in addition to the 'current' object (in your case, a Requested Item).
Check out this old Wiki article for more details: Scripting for Email Notifications - ServiceNow Wiki