Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

sarah_bioni
ServiceNow Employee
ServiceNow Employee

When working with UI Builder and Data Resources, you might expect that triggering a Data Resource on the Page is Ready event will load your data immediately. However, this often doesn’t work as intended because the Data Resource needs its own event handling to refresh and propagate data correctly.


The Issue

Calling a Data Resource directly from the Page Body (Page is Ready) event does not guarantee that the resource will fetch and update its data before components try to use it. This can lead to empty or stale data being displayed.


The Solution

To ensure your Data Resource updates effectively:

  • Configure an event inside the Data Resource itself.
  • Use the Data Fetch Succeeded event to trigger a REFRESH action.
  • Specify where the refreshed data should be applied (e.g., another Data Resource or component).

How to Configure

  1. Open your Data Resource in UI Builder.
  2. Navigate to the Events tab.
  3. Under Data Fetch Succeeded, add a handler:
    • Handler: REFRESH
    • Target: The Data Resource or component that needs updated data.
  4. Save and test.

Example

In the screenshot below, the KB Property Data Resource uses the Data Fetch Succeeded event to trigger a REFRESH on another Data Resource (KB Aggregation😞

sarah_bioni_0-1763730652245.png

 

Version history
Last update:
36m ago
Updated by:
Contributors