
- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 05-26-2022 07:22 PM
In my example, I will read and write a create a system property "date_format" in my application "UIB Examples" which scope is "x_snc_uib_examples". (If you're trying to change a Global system property it will require a separate discussion)
Let's create our own system property:
- Navigate to System Properties > UI Properties (sys_properties.list)
- Then create a new property and set the following values:
-
- name = "date.format"
- scope= your application
- type = string
- value = dd-mm-yyyy
- read & write = Add the role snc_internal
Once the property is created or you have a similar property or field to update, follow these steps:
- In UIB, Create a new data resource (db icon on the left > "Data resources" > (+ New) > Transform
-
- this opens a new page
- Note, for non-system, we could use the out-of-the-box data resource "Look up record"
-
- Name = getSystemProperty
- Description = Returns the system property
- Properties =
[{ "name":"propertyname",
"label":"Property Name",
"description":"Name of the system property",
"readOnly":"false",
"fieldType":"string",
"mandatory":true,
"defaultValue":""}] - Script =
function transform(input) {
if (!input.propertyName) return {"error" : "missing property name"};
var rec = new GlideRecord('sys_properties');
rec.addQuery('name', input.propertyName);
rec.query();
if (rec.next()) {
return {
value:"" + rec.value
sysId: rec.getUniqueValue()
};
} else {
return {"error": "property not found."};
}
} - Then click Submit
- Go back to the UIB Page
- You should see the message "Data resources have changed outside of UIB"
- Click Update Page
- Add the new data resource to your page
-
- go to Data resource instances (database icon on the left toolbar)
- in the first column, select your application
- select getSystemProperty
- Click Add
- You should see an error message "You don’t have permission to select this data resource. Contact your admin for more information". We'll fix that
- Open your getSystemProperty data resource
-
- if you closed it, in the classic explorer, search for sys_ux_data_broker_transform.list
- Open "getSystemProperty"
- Click on the menu ☰
- Click on "Copy Sys id"
- Elevate your role to "security admin" (if you don't have the security admin role, ask the admin to create the ACL for you)
- in the classic explorer search for ACL, select Access Control (ACL)
- Click New and then set the following values:
-
- Type: ux_data_broker
- Operation: execute
- Name: <the sys_id of the data resource> we copied earlier
- Role: double-click and add the role of the app user or simply 'snc_internal'
- Click Submit
- Back to UIB
- You should see the result of the data broker = {"error": "missing property name"}
- It's normal we need to set the name of the property we need.
- in the data source, set property name to "x_snc_uib_examples.date_format"
- Your screen should look like
- Bind the data resource to the input field
- Select the input field
- then select the value field in the component's config panel on the right
- Select the database icon (dynamic data binding)
- Set the value to "@data.getsystemproperty.output.value"
- Your screen should look like
- Notice how the field is populated with the correct value. The reading of the record field is done. Let's move on to the saving part
See Part 2: How to update a record with the value from a field in UI Builder?
- 5,085 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Thank you very much for this article! It is very helpful and very complete!

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
I just published part 2 here: How to update a record with the value from a field in UI Builder?

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi!
I did not find any documentation about this type of ACL and i have some doubts about how it works.
The application I am working contains strictly confidential information from our client and we would like to know more about how this type of ACL works as it needs the "snc_internal" role to work.
Is there any risk of data leakage?
best,
Thiago

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
@Thiago Pereira The ACL to execute the data broker does not require snc_internal. I just added snc_internal in case you don't have a pre-defined role. It's always recommended to use your app's roles instead. Ultimately the ACL about the records that will be queried in the data broker will be enforced so there is no risk of data leakage IF the roles are properly set up.