You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
UX Data Broker Transform Create/Update User Preference (#1574)
* Create create-update-user-preference.js
Added the code for a transform data broker that creates or updates the current user's sys_user_preference
* Create readme.md
This repository provides a data broker for creating or updating user preferences in ServiceNow. The broker allows you to specify a preference name and value, storing or updating it in the user’s preferences.
4
+
5
+
## Features
6
+
7
+
-**Create or Update User Preferences**: Provides a simple interface for adding or modifying preferences by name and value.
8
+
-**Error Handling**: Logs errors if the preference name is missing or if an unexpected issue arises.
9
+
10
+
## Template Overview
11
+
12
+
```javascript
13
+
/**
14
+
* This data broker creates or updates a user preference of the given name with the given value
15
+
* @param{{name: string, value?: string}}inputs inputs from the properties field above
16
+
*/
17
+
functiontransform({ name, value }) {
18
+
constlib="Data Broker";
19
+
constfunc="Create Update User Preference";
20
+
try {
21
+
if (!name) thrownewError("Missing required param 'name'");
0 commit comments