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

How to check device type is mobile on client side scripts

Pallavi26
Kilo Explorer

Hello,

Can anyone tell me what function to use to test device type == mobile in client side script? Like for example we use gs.isMobile() to test devices is mobile on server side script.

1 REPLY 1

Anurag Tripathi
Mega Patron

You can use gs.isMobile()  on a display BR and set a scratchpad variable based on this. In the client script just read that scratchpad value 🙂

-Anurag