i want to set the devicename of the user in host field

pavankumars3585
Tera Contributor

pavankumars3585_0-1750315930720.png

i want to set the current requested for user machine host name in the host name feild . when the requested user select the device type as desktop or laptop.

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@pavankumars3585 

you can use advanced reference qualifier to show only those Hosts for that user

OR

if you want to set the host then you can use onChange client script + GlideAjax

What did you start with and where are you stuck?

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

3 REPLIES 3

palanikumar
Mega Sage

You can do it via GlideAjax,

Create onChange Client script on variables Requested For and Device Type. This has to call the GlideAjax that gets the hostname and update the "Select the Computer Name / Host Name" field.

You can refer this url reference:

https://www.servicenow.com/docs/bundle/yokohama-api-reference/page/app-store/dev_portal/API_referenc...

 

Thank you,
Palani

Ankur Bawiskar
Tera Patron
Tera Patron

@pavankumars3585 

you can use advanced reference qualifier to show only those Hosts for that user

OR

if you want to set the host then you can use onChange client script + GlideAjax

What did you start with and where are you stuck?

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

@pavankumars3585 

Thank you for marking my response as helpful.

If my response helped please mark it correct and close the thread so that it benefits future readers.

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