We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

Set default source for mobile app HR Case

rafas_10
Kilo Sage

Hi everyone,

 

I was wondering if it was possible to set all HR Cases created via ServiceNow mobile app with the source 'mobile_app' for example without using gs.IsMobile()?

 

Thank you! 

1 ACCEPTED SOLUTION

rafas_10
Kilo Sage

Hi all,

 

I found the following solution:

Business rule 'after' 'insert' on table 'catalog_channel_analytics'.

Conditions:

engagement_channel=mobile^table_nameLIKEsn_hr_core_case^method=create^EQ

 

and script:

(function executeRule(current, previous /*null when async*/ ) {
    var hrCase = new GlideRecord("sn_hr_core_case");
    hrCase.addQuery('sys_id', current.document_key);
    hrCase.query();

    if (hrCase.next()) {
        hrCase.contact_type = "mobile_app";
        hrCase.update();
    }
})(current, previous);
 
And it works 🙂

View solution in original post

8 REPLIES 8

sandeepdutt
Tera Patron

Hi @rafas_10 ,

There is no OOTB way to setup, you will have to customize unfortunately.

 

Thanks,
Sandeep Dutta

Please mark the answer correct & Helpful, if i could help you.

Hi @sandeepdutt ,

Any ideia how I can achieve this even with customization?

Ankur Bawiskar
Tera Patron

@rafas_10 

from mobile how are they submitting case?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar ,

From the Now mobile app