- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2025 03:41 PM
Hello ServiceNow Community,
I'm working in UI Builder (Xanadu release) and trying to implement a dynamic list of filters using the List Selector component, where each List Selector corresponds to a different category. My approach is to place the List Selector component inside a Repeater.
The Repeater itself is functioning correctly: it iterates through my data, and I can see six distinct List Selector components rendered on the page, each with its correct category label. However, all of these List Selectors appear empty, not displaying any selectable items.
Here's my setup and what I've tried:
Repeater Data Source (Data array script):
My script transforms data from a look_up_multiple_records data resource into an array of objects. Each object represents a category and contains an options object for the List Selector.
The output for a single repeater item looks like this:
{
category: "type",
options: {
Virtual: {
label: "Virtual",
},
AnotherValue: {
label: "Another Display Value",
},
},
}
(This structure is consistent for all categories)
List Selector Configuration (inside the Repeater):
Items property: Bound to @item.value.options.
- Checked: UI Builder's property preview for this binding correctly shows the expected object (e.g., {"Virtual": {"label": "Virtual"}}).
Label property: Bound to @item.value.category.
Working: The label for each List Selector correctly displays the category name (e.g., "type", "role"). This confirms the @item.value context is resolving correctly and the repeater is iterating as expected.
Items Root property: This is completely empty/unbound.
Reasoning: Based on the ServiceNow documentation for sn-list-selector and the structure of my items object, no itemsRoot is required as the items object itself directly contains the list of selectable items. I have tried binding it to @item.index or @item.value.category but this resulted in empty lists, which is expected given the itemsRoot's purpose.
Selected items property: Temporarily set to [] for testing, to ensure no selection issues are hiding items.
Troubleshooting Steps Taken:
Thoroughly checked console.log outputs from my data script in the browser console.
Cleared UI Builder cache and browser cache multiple times.
My Question to the Community:
Given that the repeater renders the List Selector components, the data being passed to the items property appears correct (confirmed by console.log), and the itemsRoot is left empty as per documentation for this data structure, why would the List Selectors still be empty?
Has anyone successfully used the List Selector component inside a Repeater in UI Builder, specifically in the Xanadu release or similar versions? Are there any undocumented quirks, specific property settings, or alternative approaches required for this setup to display items correctly?
Any insights or working examples would be greatly appreciated!
Thank you!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-28-2025 12:17 AM
Hi,
The payload you are mapping on items should be in this format
{
"task": {
"virtual": {
"label": "Virtual"
},
"Another_value": {
"label": "Another value",
"additionalData": "<b>Additional data:</b><br>Press > to open item",
"reference": "sys_user"
}
},
"sys_user": {
"active": {
"label": "Active"
},
"avatar": {
"label": "Avatar"
}
}
}
Schema:
{
"type": "object",
"properties": {},
"additionalProperties": true,
"patternProperties": {
"^.\\S*$": {
"type": "object",
"properties": {},
"additionalProperties": true,
"patternProperties": {
"^.\\S*$": {
"type": "object",
"properties": {
"label": {
"type": "string"
},
"reference": {
"type": "string"
},
"additionalData": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"label"
]
}
}
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-28-2025 12:17 AM
Hi,
The payload you are mapping on items should be in this format
{
"task": {
"virtual": {
"label": "Virtual"
},
"Another_value": {
"label": "Another value",
"additionalData": "<b>Additional data:</b><br>Press > to open item",
"reference": "sys_user"
}
},
"sys_user": {
"active": {
"label": "Active"
},
"avatar": {
"label": "Avatar"
}
}
}
Schema:
{
"type": "object",
"properties": {},
"additionalProperties": true,
"patternProperties": {
"^.\\S*$": {
"type": "object",
"properties": {},
"additionalProperties": true,
"patternProperties": {
"^.\\S*$": {
"type": "object",
"properties": {
"label": {
"type": "string"
},
"reference": {
"type": "string"
},
"additionalData": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"label"
]
}
}
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-28-2025 12:22 AM - edited ‎06-28-2025 12:22 AM
One more thing, name from Items Root should match a key in your payload
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-30-2025 09:53 AM
Thank you so much! I applied the changes to my configuration, and they resolved the issue with the repeater.