UI Action to Flow Designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2024 09:01 PM
Hello All,
Is there a way to pass the data from dialog box to flow designer?
I want to pass the sysid of user selected from dialog box to the flow designer and trigger the flow when click ok.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2024 09:44 PM
Hi @Al-jhon,
I am assuming you are triggering a Flow from the dialog after it's submitted.
Have a look at this article - https://www.servicenow.com/community/now-platform-forum/triggering-a-flow-with-inputs-from-a-script/...
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2024 10:16 PM
Hello @James Chun , yes i want also to trigger a flow after clicking OK in a dialog box and pass parameters at the same time to flow i trigger.
Do you think i can get the data from UI action using Set Flow Variables in FD?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2024 10:26 PM
I believe you need to have inputs configured within a subflow/action.
i.e.
I don't believe there is a way to send it to a Flow variable (I could be wrong).
Looks like your Flow is triggered from a service catalog, is there a reason you want to trigger it via script? That may break references within your Flow.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2024 10:56 PM
@James Chun my requirements is to change the Approver using UI Action.
I already created a UI Page where I can select a new approver (reference to sys_user).
And after selecting the user, I want to pass the sysid of the selected new approver to flow and trigger it to update the field "Approver",
Changing the approver using Client Script in UI Pages is not working.
I can change the value but upon saving or updating the form it will revert back to the old approver.
I used script below:
var newapprover = document.getElementById('approver').value;
var sysId = gel('record_sys_id').value;
alert(newapprover); // has value which is the sysid of the selected new approver
alert(sysId); // sysid of the Approval Record
var rec = g_form.setValue('approver', newapprover);
rec.update();
So, my other option is to update the record via Flow Designer, because i can change the value of approver using FD.
And now i'm stucked in passing the data from dialog box to FD.