How to call a server script and return Json object from Ui builder

Louay saeed
Kilo Explorer

I am trying to find a way that is similar to server script in service portal but in UI builder. I have seen some suggestions to use Data broker server script. What I am basically trying to do is use GlideRecord to add new record using Data broker server script. The data that i pass to it in the format of JSON and i want to return a JSON that contains the result and sysId of newly created record. I was not able to do it . Is there any similar example to this approach ?  

1 REPLY 1

Brad Tilton
ServiceNow Employee
ServiceNow Employee

Hi Louay,

You can execute server side javascript using a transform data resource in UI Builder. If you take a look at the second video in this blog post it may help with that. https://developer.servicenow.com/blog.do?p=/post/quebec-ui-builder-data-resources/

(Don't forget to add an ACL if you've created your own data resource)