UI Builder call of data resource uncertain

ozgurD
Tera Contributor

Hi,

I have 2 input text fields, both of which contain an event with “Update client state parameter”. So far everything is fine.
However, as soon as I enter something in the first input text field, my data resource is triggered without the second input text field.
Do you know why this can happen and how I can prevent it? I also can't find anywhere where my data resource is called. How can that be?

1. Input field:

ozgurD_0-1745572250469.png

2. Input field:

ozgurD_1-1745572280779.png

 

4 REPLIES 4

Brad Tilton
ServiceNow Employee
ServiceNow Employee

Just an FYI, if you bind a client state parameter to a data resource property, and the CSP changes, the data resource will automatically refresh (unless it's marked as mutating data). That means if you've bound both your CSPs to the data resource and you set one of the CSPs the data resource is going to go get data before you set the second one.

Thank you for the information. Is there any way I can avoid this? Or how should I integrate the two TextInput fields so that the two client state parameters only change when the button is clicked?

Dibyaratnam
Tera Sage

change the data resource properties to a single variable and update that variable only if both the input CSP are updated or as per your required logic.

The first input field (so first CSP) need to be mandatory and the second can be transferred but does not have to be. So I would change the data resource to a single variable with the mandatory field but do I need to create a second data resource for the second field? But how do I match the second field with the first?