- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-22-2021 06:14 AM
Hello,
How can I access variables using a UI action?
I need to be able to create a new record through a UI Action. My UI Action works, but I have no idea how to access the variables and use them to set fields on the new record. My UI Action currently captures regular fields. How can I get the current variable value and set it in the new record?
UI Action:
var gr = new GlideRecord("table 1");
gr.assigned_to = current.assigned_to;
gr.short_description = current.short_description;
gr.description = current.description;
gr.insert();
action.setRedirectURL(gr);
action.setReturnURL(current);
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-22-2021 06:16 AM
Hi,
You should be able to access the variables by
current.variables.<variable name>
-Anurag
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-22-2021 06:16 AM
Hi,
You should be able to access the variables by
current.variables.<variable name>
-Anurag
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-22-2021 08:34 AM
How can I trigger a workflow on a successful record creation? If the record is not created, I don't want to trigger the workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-22-2021 08:37 AM
That you can do from workflow itself
-Anurag
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-22-2021 08:43 AM
Thanks for your response - I am rewritting an existing process. The current UI action collects data and sends to the workflow, triggering the start. What I am doing now is creating the record first and then initiating the workflow. We have 2 different processes, that's the reason for triggering workflow through the UI Action on a successful record creation.