The CreatorCon Call for Content is officially open! Get started here.

UIB Builder: Catalog Item component: How do I refresh form after submission to reuse the page?

Phillip Melmoth
Tera Contributor

Hi

 

I'm configuring a Configurable workspace. I have a workspace-style homepage with a list on it. The list "New" button event is configured to open a new page which has a single catalog item component for the user to raise a new request from the catalog item.

 

When the request is submitted the event navigates to another page to show the newly created record.

Everything above works perfectly.

 

The problem is, when the user goes back to list view and clicks to create a 2nd new request, it goes back to the catalog item page and the Submit button is greyed out. I have to refresh the page to reset the form to create a new request.

 

My question: How can I configure the catalog item component to reset the form at the same time as navigating to the new record page?

6 REPLIES 6

Cobee
Tera Expert

Having the same issue. We're you able to figure out a solution for this? 

d_ramos
Tera Contributor

Same issue here did anyone found a workaround ? There is also an idea created for this -> View Idea Page - Idea Portal (servicenow.com)

Cobee
Tera Expert

Hey @Phillip Melmoth @d_ramos 

One thing that I did was set up a onSubmit client script on the record producer itself. So when the submit button is clicked it will refresh the page. 

Try this script as part of the OnSubmit client script and see if that works. 

function onSubmit() {
  // Perform any necessary operations before submitting the form
  
  // Submit the form
  g_form.submit();

  // Refresh the form after submission
  setTimeout(function() {
    location.reload();
  }, 2000); // Adjust the timeout value as needed
}

Phillip Melmoth
Tera Contributor

@Cobee@d_ramos 

 

Honestly not sure how I got this fixed. At the time of writing I was on San Diego and these days Tokyo. A number of snags I had with workspaces have vanished over the months.

Now when the New button is clicked I only have a Save button (not Submit) and it correctly loads the new record into the same tab after submission. The users can therefore go back to the Home and click new again and create more as needed.

 

My List configuration has an event configured when "New Button clicked": The event is Link to Destination. The page is simply /record, table is the table name for the new record and sys_id is -1