UI Action Redirect to Portal - Pass caller_id to portal form requested_for where default exists
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
I am creating a context list ui action to create a hardware request from an incident record. I have it correctly opening a new tab to the correct form, but I am trying to pass the caller_id from the incident into the requested_for variable on the form. However, this form uses a default value for requested_for (whomever the current user is).
Is there a way to override this default value when doing this?
function do_it() {
var callersysid = g_form.getValue("caller_id");
var url = "https://elementcorp.service-now.com/esc?id=sc_cat_item&sys_id=df1e87ebdbdab5942620230bd39619d0" + "&sysparm_query=requested_for=" + callersysid;
top.window.open(url,);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
use onLoad catalog client script to grab and populate.
It should work if you are not making that variable readonly at variable config level.
function onLoad() {
var url = top.location.href;
var caller = new URLSearchParams(url).get("sysparm_query");
g_form.setValue('requestedForVariable', caller);
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader