[UI BUILDER/WORKSPACE] Refresh page or ui components instead of data

DJOUL
Tera Contributor

Hi SN Experts,

 

I created a new experience on UI Builder with pills that applies filter on the page (With client scripts and client state parameter when click)

The "Reset Filters" button remove all applied filters.

DJOUL_0-1710923830863.png

The issue :

When those filters a removed, data are reloaded but not the html elements.

 

The solutions i need is a client script code to :

- Hard reload the entire page

- Hard reload the pill list UI component and not only data.

 

Thank you in advance for your help,

Julien.

6 REPLIES 6

Brad Tilton
ServiceNow Employee
ServiceNow Employee

Hi Julien,

 

There is not a programatic API to refresh the entire page. As far as refreshing components goes, if you bind data to a component property, and the data changes, the component should automatically refresh itself. Could you provide more info around which components specifically aren't refreshing?

Hey Brad, I've made a dynamic checklist in the sidebar using THIS ARTICLE  
The component works quite well however, the checklist is created in a BEFORE BR and when the Case record is presented in the workspace the checklist component is empty. close and reopen the tab or refresh the page.....its there.  

I've tried page ready events to refresh the data source, alter the data so refresh is auto triggered. Nothing. I suspect the data is refreshing but the sidebar tab is not re-rendering

Ah my proper account...

DJOUL
Tera Contributor

Hey Brad,

 

Thank you for answering. 

So here i am using the Pill list component to dynamicaly create pills that will apply a filter onclick (exemple: "assigned_to=selectedPill.sys_id").

I also have reports on this page. the filter used by  all elements on the page is in a client state parameter called "encodedQuery" and the reset filter erase this filter to it's base.

DJOUL_0-1711034917885.png

 

I have a transform data broker to convert data into Pill List desired format :

DJOUL_0-1711061096064.png

When i select a pill, a client script is triggered and the filter is updated.

for me the issue is because there is hidden properties on pills like a "selected: true/false" to trigger the "pill selected" css that is not updated with the data.

 

In this exemple i select the 3rd category pill, which update the stakeholder pill list.

DJOUL_2-1711061395778.png

i select the 2nd stakeholder pill then i click on reset filter so there is no category and stakeholder selected, the data are refreshed to show all stakeholders

DJOUL_3-1711061851655.png

we can see that the pills selected are still the 3rd and 2nd.

 

do you know how can i refresh the properties "selected: true/false" in the html elements ?

 

Thank you in advance.