UI Builder – Transform Data Broker showing “Data resource is not configured”
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday - last edited yesterday
Hi All, @Mark Roethof @Ankur Bawiskar @Ravi Gaurav
I am implementing a use case in UI Builder (Workspace) where I need to identify duplicate accounts and navigate users to a filtered list view.
We maintain user records in a custom table x_user_directory
Requirement:
When a user clicks a “Duplicate User” tile in UI Builder:
Detect duplicate accounts based on:
email
employee_number
(optionally compare with sys_user.email)
Collect duplicate record sys_ids
Navigate to the list of such records
Current Implementation
1️⃣Data Broker Server Script (Transform Type)
I created a Data Broker Server Script (Transform) with logic similar to:
(function transform(input) {
var dupRecordsMap = {};
// Duplicate check in custom table
var ga = new GlideAggregate('x_user_directory');
ga.addAggregate('COUNT', 'email');
ga.addNotNullQuery('email');
ga.groupBy('email');
ga.query();
while (ga.next()) {
if (ga.getAggregate('COUNT', 'email') > 1) {
var gr = new GlideRecord('x_user_directory');
gr.addQuery('email', ga.email);
gr.query();
while (gr.next()) {
dupRecordsMap[gr.getUniqueValue()] = true;
}
}
}
// Optional cross-check with sys_user
var userGR = new GlideRecord('sys_user');
userGR.addNotNullQuery('email');
userGR.query();
while (userGR.next()) {
var userGR = new GlideRecord('x_user_directory');
userGR.addQuery('email', userGR.email);
userGR.query();
if (userGR.getRowCount() > 1) {
while (userGR.next()) {
dupRecordsMap[userGR.getUniqueValue()] = true;
}
}
}
var ids = Object.keys(dupRecordsMap);
return {
sysIds: ids.join(','),
count: ids.length
};
})(input);2️⃣Output Schema
Added this Output Schema:
{
"type": "object",
"properties": {
"sysIds": {
"type": "string"
},
"count": {
"type": "number"
}
}
}3️⃣ACL Configuration
Initially, I received:
ACL did not allow execution
To fix this, I created:
ACL Type: ux_data_broker
Operation: execute
Name: sys id of data broker server script
Role: admin
Now the ACL error is resolved.
UI Builder still shows:
Data resource is not configured
Add details in the configuration for Duplicate Account IDs to review the data output
Please help me to understand how to navigate on required list of duplicate records.
