LogiUpSkill

Datalookup in Service-now

Data LookUp :

This is the rule table that defines the rules that automatically set one or more field values when certain conditions are met. (At client side)

For example , in the Incident table we can set the value of “Assigned to” field depending on the combination of “Category” and “SubCategory” fields.

Say , if “Category” is “Hardware” and “Subcategory” is “Keyboard” then Set “Assigned to” as “John”

Problem Statement :

Set the values for Address and User according to Name .

Create Data Lookup Table :

  1. Create a new table as a data lookup table.

  To create data lookup table,it must extend the Data Lookup Matcher Rules [dl_matcher]        table, as shown in below snapshot,

Datalookup in Servicenow Save the above table.

  1. Create the same fields as in the Source table (table for which this data lookup table is created) for which we want to set the rule.

 As per the problem statement,

 Create fields: Name,Address and User in “Demo Rule Table”.

Datalookup in Servicenow

Datalookup in Servicenow

  Save above changes.
  1. Now Open the Demo Rule table (Data lookup table) and set the values for the fields as below,

Datalookup in Servicenow

Set all the values that we required,(see the list below),

Datalookup in Servicenow

Create Data Lookup Rules:

  Now map the data lookup table and Source table. For that follow the following steps,

  1. Navigate to Data Lookup Definitions and Click on New Button.

Datalookup in Servicenow Click on Data Lookup Rule.

The following form will be displayed,

Write Source table On which we want to apply the rule and Matcher Table in which we have created fields on which we have to set the Rule,

Check checkboxes,

Active :

(run on client side)

Select this check box to run this data lookup rule. Clear the check box to ignore this data lookup rule.

Run on Form change :

(run on client side)

Select this check box to automatically look up values whenever a user or onChange client script changes a field value on a source table form.

Run on insert :

(run on server side)

Select this check box to automatically look up values whenever a user creates a new record.

Run on update :

(run on server side)

Select this check box to automatically look up values whenever a user saves or updates a record.

Save this Form.

Open the saved  Data Lookup Definitions ,

At the bottom,

Click on “Matcher Field Definitions ” tab and Click on New button, following form will be displayed.

Map the Source table and Matcher table(Data lookup table) fields as shown in above snapshot,

Check the “Exact  lookup match “ checkbox if you want to make it case sensitive.

Save the above changes.

Now Click on “Setter Field Definitions” and Click on New Button as shown in below snapshot,

Map the fields that we want to set the values depending on the Matcher Field Definitions as below,

Set all the fields,

Now Open the new form for the source table.

Type Name as “Ashwini” .

The fields “Address” and “User” will be automatically populated as “Pune” and “Ashwini More” respectively.

See below snapshot,

But if we change Name to another name , Say Sonia the Address and User values does not change. (see below snapshot)

Because in Data Lookup Definitions, In Setter field Definitions , we have set the Always Replace value to false.

Set the value of “Always Replace“ as “true” for all fields.(See below snapshot)

Save above changes and check again in the source table.

Datalookup in Service-now