UI Builder LookUp Single Record

KamakshiM
Tera Contributor

I am trying to display a modal with values from a repeater on click of a button . The modal is not displaying the values correctly. 

Sometimes, it displays the correct values and at other times, it displays some default value.

I have verified that:

- the client state parameter is bound properly to the repeater sysid value

-the REFRESH event is called for the repeater .

Is this some known bug in Xanadu UI Builder?

3 REPLIES 3

pratikjagtap
Giga Guru

Hi @KamakshiM ,

 

It looks like you're not alone—this behavior has been reported by other developers working with Xanadu UI Builder, particularly when using modals triggered from repeaters. The issue seems to stem from timing or state synchronization problems, where the modal sometimes picks up stale or default values instead of the intended context.

 

1: Double-check the binding timing: Ensure that the modal is not opening before the client state parameter has fully updated. You might introduce a slight delay or use a setTimeout to defer the modal opening until after the state change.

2:Use a dedicated ViewModel or Data Resource: Instead of binding directly from the repeater to the modal, consider storing the selected record in a separate client state or data resource, and bind the modal to that. This can help isolate the data flow.
3: Force a rebind or refresh: If you're already calling a REFRESH event, try explicitly resetting the modal’s data source or re-evaluating the bindings when the modal opens.
4:Check for known issues in your patch version: ServiceNow’s Known Error article for Xanadu Patch 7 might have more details if this is a documented bug.
If you’d like, I can help sketch out a workaround using a ViewModel or walk through a sample configuration. Want to give that a shot?

 

If my response helped, please hit the 👍Thumb Icon and accept the solution so that it benefits future readers.

 

Regards,
Pratik

Hi Pratik,

  Thank you so much for your response. I really appreciate it.

I spent some time trying your suggestions.

1. I created a client script to delay the modal opening by setting a timeout up to 10 secs. No luck.

2.I am using a client state parameter and a Lookup Single Record data source to populate the modal. It still doesn't work.

3.Could you please elaborate on this? 

4.Yet to explore this.

 

Thanks,

Kamakshi

Update: 4. I checked the Known Issues for Xanadu. This issue is not listed.