- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2022 07:42 AM
Hello! I'm working on a portal in UI Builder and have been trying to set up an EVAM to basically get a service catalog going. Right now it's only got record producers in it, but I was wondering if there's a way to have the EVAM respect the "Available for" user criteria when returning the cat items and producers?
I can't seem to get anywhere beyond the basic EVAM config documentation that's out there and I didn't see any specific catalog oriented component available in UIB. Has anyone set up a catalog in a UIB portal and run into this before?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2022 12:47 AM
Hi Aaron,
I haven't tried this but I believe this should work,
1. configure EVAM to fetch records "dynamic me".
2. create a transform and get input from EVAM to check the criteria, you can infuse this API in the script section of the transform to check the access.
GlideappCatalogItem.get('catalog item sys_id').canView();
collect the items and return the transformed object.
Thanks
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-07-2022 02:03 PM
This worked! I can't do a dynamic me on the EVAM definition since it's pulling from sc_cat_item_producer, but I was able to create a transform on the output that then returned the correct items based on whether the logged in user is allowed to view them. Here's what I did:
- New record on sys_ux_data_broker_transform
- While you're at it, make a new ACL with a type of ux_data_broker and an operation of execute -- set the name to the sys_id of your new transform created in step #1. Add whatever security you need onto it, but you can't use the transform without an ACL.
- Back on the transform - add a property to get the output from an EVAM definition as an input to the transform:
-
[ { "name": "evambroker", "label": "EVAM Broker", "fieldType": "json", "valueType": "object", "readOnly": false, "mandatory": true, "description": "Graphql Query Output - Data bind to @data.evam_broker.compositeDataViews" } ]
-
- In the script field, add the necessary loop so we can loop through the output of the items from the EVAM broker.
-
function transform(input) { // Loop backwards through the EVAM Broker's output so we don't have to deal with indexes as we splice for (var i = input.evambroker.items.length - 1; i >= 0; i--) { // Grab the catalog item/record producer sys_id var catItemId = input.evambroker.items[i].propValues.model.sysId; // Check if the logged in user is allowed to view it based on its user criteria if (!GlideappCatalogItem.get(catItemId).canView()) { // If they aren't allowed, remove it from the EVAM's output input.evambroker.items.splice(i, 1); } } // Return the entire EVAM output, minus the items the logged in user isn't allowed to view return input; }
-
- Back in UI Builder, open the page you need the transform on, add it in the data section, and bind the transform's input to your EVAM broker's compositeDataViews (e.g. @data.evam_broker.compositeDataViews).
- Change your component that's consuming the data (repeater, data row, etc.) to use the output from the transform.
- Since the transform is returning exactly the same structure as the EVAM broker was originally outputting (just with less items in the array), you should be able to do the same exact data binding on the component, just using the name of the transform instead of the name of the EVAM broker.