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.

UI Builder Data resource

sanketmohit
Tera Contributor

How to show the related list records on the workspace??

for e.g i want to show all the open incidents related to parent case in one separate UI builder page and all the close incident in another UI builder page?? 

1 REPLY 1

Shivalika
Mega Sage
Mega Sage

To show related list records - 

 

### **Step 1: Create Data Resources to Fetch Open and Closed Incidents**

Since you want to display **Open Incidents on one page** and **Closed Incidents on another**, you need two separate **Data Resources** in UI Builder.

 

#### **1.1 Create Data Resource for Open Incidents**

1. Go to **UI Builder** (`/now/ui-builder`).

2. Select the **Workspace Experience** where you want to add this.

3. Navigate to **Data Resources** → **+ Add Data Resource**.

4. Choose **Table** as the data source.

5. Select the **Incident (`incident`)** table.

6. Set the condition:

   - `Parent Case` = `@context.case_sys_id` (Dynamic reference)

   - `State` is **not Closed**

7. Name it **"Open Incidents Data"** and save.

 

#### **1.2 Create Data Resource for Closed Incidents**

Repeat the above steps, but change the filter:

   - `Parent Case` = `@context.case_sys_id`

   - `State` is **Closed**

   

Name it **"Closed Incidents Data"**.

 

---

 

### **Step 2: Create UI Pages for Open and Closed Incidents**

Now, create two separate UI Pages in UI Builder.

 

#### **2.1 Create UI Page for Open Incidents**

1. In UI Builder, create a **New Page** and name it **"Open Incidents Page"**.

2. Add a **Repeater Component** (to display the list).

3. Bind the **Repeater Component** to the **"Open Incidents Data"** resource.

4. Configure the **Repeater** to display:

   - Incident Number

   - Short Description

   - Assigned To

   - Priority

   - Other required fields

 

#### **2.2 Create UI Page for Closed Incidents**

Repeat the same steps as above but bind the **Repeater Component** to **"Closed Incidents Data"**.

 

---

 

### **Step 3: Link These Pages in the Workspace**

1. Add navigation options (like buttons or links) to **navigate** between the Open and Closed Incident pages.

2. You can use the **"Navigate to Page"** action in UI Builder.

 

Kindly mark my answer as helpful and accept solution if it helped you in anyway,

 

Regards,

Shivalika 

 

My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194

 

My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY