submit and redirect to list view in custom app
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
Hi,
I have a custom app I am making in ui builder and I am wondering if someone can help me with a updating a the script on a ui action so that after I submit a form, it goes back to the list view of the form just like in native ui.
I tried the following script but it is still not redirecting back to list view after submitting successfully:
answer = current.insert();
if(answer){
action.setRedirectURL(current.getTa
bleName() + '.list')
}
gs.include('ActionUtils');
var au = new ActionUtils();
au.postInsert(current);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
7m ago - last edited 2m ago
Hello @BrianaC,
I’m still a bit newer to UI Builder myself, and finished the UI builder course a few weeks ago. I haven't tried this out yet, but this is what I am thinking might work.
Instead of redirecting from the UI Action, I’d try handling this through events:
Open the component that’s doing the submit (button or form)
Go to the Events tab
Add an Event Mapping for the successful create/update event
From there, use a navigation action like Link to destination and point it back to your list page
Reference doc:
Manage actions in UI Builder pages
edit: I also see that it works with now assist, so this might be something cool to try out.
Configure an event handler with Now Assist
I hope this helps!
Sr. ServiceNow Developer | Infosys