default Channel to 'Internal' on incidents created from Service portal if the company name is "XYZ"

Nandini Mishra
Tera Contributor

Hi All,

 

I have a requirement to set the Channel(Drop down field) field to "Internal" whenever the incident submitted from the portal has a company name value as "XYZ"

Also, it should be manually changed by the agents. How to achieve this? 

1 ACCEPTED SOLUTION

Laszlo Balla
ServiceNow Employee
ServiceNow Employee
  1. If not already created, add a new choice for the Channel field called 'Internal' (if the instance is used in multiple languages, remember to get translated labels added too).
  2. Create an Before Insert Business rule, where you can configure this without any scripting:
    1. LaszloBalla_0-1674488397962.png

       

    2. LaszloBalla_1-1674488467709.png

       

Set the company to whichever you want and set your Channel value Internal (I don't have it). The order of the business rule can be fairly high unless some other BRs are dependent on having the channel set to Internal. You can also consider using an After Insert business rule.

You ca consider adding further condition in the Business rule, e.g. to check if Channel is set to Self-Service which would normally indicate that it was triggered from the portal.

 

Another way to achieve this is to add some script to the record producer, something like:

var companyId = ''; // Add here the sys_id (!) of the company to check for
if(current.company == companyId) {
  current.contact_type = 'intrnal'; // this must be the VALUE of the Internal choice option, not the label!
}

 

A third option is to create a new flow in Flow Designer, with a 'Record Created' trigger with similar conditions as in he BR, and have an 'Update Record' action to set the channel field.

View solution in original post

1 REPLY 1

Laszlo Balla
ServiceNow Employee
ServiceNow Employee
  1. If not already created, add a new choice for the Channel field called 'Internal' (if the instance is used in multiple languages, remember to get translated labels added too).
  2. Create an Before Insert Business rule, where you can configure this without any scripting:
    1. LaszloBalla_0-1674488397962.png

       

    2. LaszloBalla_1-1674488467709.png

       

Set the company to whichever you want and set your Channel value Internal (I don't have it). The order of the business rule can be fairly high unless some other BRs are dependent on having the channel set to Internal. You can also consider using an After Insert business rule.

You ca consider adding further condition in the Business rule, e.g. to check if Channel is set to Self-Service which would normally indicate that it was triggered from the portal.

 

Another way to achieve this is to add some script to the record producer, something like:

var companyId = ''; // Add here the sys_id (!) of the company to check for
if(current.company == companyId) {
  current.contact_type = 'intrnal'; // this must be the VALUE of the Internal choice option, not the label!
}

 

A third option is to create a new flow in Flow Designer, with a 'Record Created' trigger with similar conditions as in he BR, and have an 'Update Record' action to set the channel field.