Reference Fields with the snRecordPicker Directive

One of the very powerful directives available in Service Portal that we will be covering today is the snRecordPicker. This directive generates a field very similar to a reference field in the platform. This is very useful when creating custom widgets that will be interacting with tables and records in ServiceNow. The Directive: [crayon-662373f08cbd2009519116/] It supports the following properties: Property Description field a JavaScript object consisting of "displayValue", "value" and "name" table the table to pull records from default-query the query to apply to the table display-field (or display-fields) the display field value-field the value field (usually sys_id) search-fields the fields to search page-size number of records to display in dropdown   To use the snRecordPicker you will also need to create the "field" object in your controller as well as listen for the "field.change" event. The Controller: [crayon-662373f08cbe6455474613/] The Widget: I've created a sample address picker widget that allows the user to select a location, and then retrieves the record from the server and populates several other fields with the information. The widget is available for download here: https://serviceportal.io/downloads/snrecordpicker-example/

Geneva Service Portal – Creating a “Hello World” widget

In this tutorial I create a simple Hello World widget that makes a call to the server to retrieve the "name" of the user based on the "username" entered in the input. This tutorial is specific to the Geneva version of Service Portal. Also in case you missed my big announcement made earlier today: I'm now available for contract work. HTML Template: [crayon-662373f095ff9767246060/] JSON Data Producer: [crayon-662373f096008645678220/] Client Script: [crayon-662373f09600d366444065/]