UI Builder "sticky buttons" not refreshing

Roger11
Giga Guru

We have existing UI Action buttons on the classic forms that we want to replicate on the Workspace forms, but the issue we have is that clicking the button in the Workspace opens up a new tab on the form, which allows us to navigate back to the previous view and the wrong button is now available to the user which when clicked throws an error message.

 

The basic flow should be

  • click the Perform AQI button > a new tab opens with action button to Submit AQI
  • if user clicks on the Details tab returning them to the KB page the Perform AQI button should now be hidden (but it isn't) and the Continue AQI button should now be visible  (but it isn't) - it seems like this particular tab needs to be refreshed to update the Action buttons to be displayed (but it isn't).

So we have several tabs with action buttons that are available on the classic forms that we've checked the options to make them available on the workspace forms which works - but the refreshing characteristics available to those UI Actions create a poor UX as they aren't automatically being refreshed. We've tried a variety of options mentioned elsewhere such as "this.document.location.reload()" etc but nothing seems to be working. I'll try add some screenshots to improve this question at a later time, but our organisation seems to be blocking my ability to achieve this - so I'll do it from home later.

 

3 REPLIES 3

Roger11
Giga Guru

Here are the screenshots:

The Perform AQI button

Roger11_0-1727996795414.png

when clicked opens the AQI record on a new tab. Which shows the Submit AQI button relating to that record.

Roger11_1-1727996880123.png

But if you click back on the Details tab to return to the KB record, the button still shows the Perform AQI button.

Roger11_2-1727996939741.png

And clicking on it generates an error message

 

Roger11_4-1727996996935.png

If I refresh the page, the Perform AQI is then hidden and the Continue AQI action is available

Roger11_5-1727997075338.png

The OOTB UI Action for Perform AQI looks like this

Roger11_6-1727997431648.png

The Workspace section of the UI action looks like this. 

Roger11_7-1727997464550.png

I can't find any useful documentation that would indicate how to make this behave in a useful manner in the Workspace setting by only refreshing the tab where the action is clicked.

Brad Tilton
ServiceNow Employee
ServiceNow Employee

Hi Roger,

 

You need the page or data on the page to refresh in order to refresh the buttons. By default, clicking back into a tab does not do any refreshing. I think you're likely going to need to add a record watcher data resource to your original page that watches whatever the buttons are keying off and then updates the form controller data resource.

I've provided a very specific OOTB example where a KB article goes through the AQI process. I googled what you mentioned and found this page which is quite informative, but looking at the filter criteria, because there are two tables involved - I can't see any obvious way to set up a query where a KB_KNOWLEDGE record has a KB_ARTICLE_CHECKLIST_SUMMARY record related to it in a currently open state.

Roger11_0-1728263765997.png

Roger11_2-1728263856720.png

And when you consider the complexity of the filter on the existing UI Action button is:

Roger11_5-1728263976356.png

 

Roger11_4-1728263940679.png

It seems that UI Builder could do with a simple means to be able to refresh the current tab that a UI Action is fired from (or being able to use to DOM to address different tabs and refresh those.