UI Builder: Contents of Repeater components don't refresh after data source is dynamically updated (filter)

Philip Middlema
Tera Contributor

Hi, First post and still relatively new to ServiceNow.

I'm building a page in UI Builder using some repeater components. The repeaters have a nested container which in turn have 3 Stylised Text Components pulling dynamic data using @item... from a dynamic data source bound to the repeater.

I have a dropdown I'm using to allow users to select 1 of 7 options which will affect the filter of the dynamic data I'm pulling in via a Lookup Records. The dropdown updates a client state string parameter on change. This client state parameter is referenced in the data source filter.

My problem is that when the user selects a different option in the dropdown the data in repeater components doesn't update (i.e. they aren't dynamical refreshed when the data source is updated) 

However, linking the same data source to a simple list shows that the dropdown is working when a new option is selected with the list data refreshing as expected. But data in the repeaters does not.

Is this a limitation of the repeater component? or am I doing something wrong?

11 REPLIES 11

Mark Manders
Mega Patron

Do you refresh your repeater component through an event, when a different option is chosen?


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

No,

Sounding like total ServiceNow Noob, (because I am 🙂 ) How would I go about refreshing a repeater through an event? Repeaters don't have any event listeners so presume it would have to be done via the onChange of the dropdown?

I'm totally comfortable doing JavaScript if that is the best way. 

Is there a simple method (I can't find a one documented) to programmatically tell the Repeater to repeater_id.refresh() from inside a script?

Both the data resource and repeater should change if the data bound to them changes. 

That being said I ran a quick test and it looks like there may be an issue with the Look up records data resource not refreshing if you've bound something to a specific line in the condition builder. For example:

find_real_file.png

When my category CSP changes my data resource didn't refresh. I would open a support ticket for this (although I haven't tested if it works in Tokyo), but a workaround may be to fire the refresh event manually for your data resource after you set the CSP.

Something like this:

find_real_file.png

Hello @Brad Tilton 

bouncing on this comment "Both the data resource and repeater should change if the data bound to them changes. "

does it mean that if i have:

- a lookup records data source on a given table

- a component bound to this data source

an update on the table should cascade to the component automatically?

If yes, then it does not work on my side. If not, maybe you have an idea how to refresh a component after table changes?

thanks a lot for your help

Romu