How to Auto-Populate Fields in ServiceNow Mobile Input Forms

rohanaditya
Tera Contributor

Autopopulate Fields in Mobile Input Form

 

Key points covered:

  • How to use Mobile Callable Script Includes
  • Autopopulating fields in Mobile Input Form

Use Case:

Populate default Assignment Group in of the Field in Mobile Input form.

 

Steps to Implement:

1. Create a Script Include and Mark it as Mobile Callable.

 

var MobileUtils = Class.create();
MobileUtils.prototype = {
    initialize: function() {},

    populateDefaultAssignmentGroup: function() {
      var assignmentGroup = gs.getProperty('service.desk.group'); //Storing sys_id of deafult group in system property 
        return {
            "Value": assignmentGroup.toString(),
            "DisplayValue": "IT Service Desk"
        };
    },
    type: 'MobileUtils'
};

 

2. Create Assignment Group Variable and set variable type to Scripted

 

mobile-image2.png

 

3. Create Variable attribute and select name as Script and call script include in Value.
 
mobile-image1.png

4. Create Assignment Group Input field, in that under Autofill variable select the above Assignment group variable

 

mobile-image3.png

 

For a detailed approach, visit my blog post,

https://rohanaditya-servicenow.vercel.app/MobileInputForm.html

And my blog site,

https://rohanaditya-servicenow.vercel.app/

 

0 REPLIES 0