Help with Setting Up Field Dependencies in Catalog Item (Laptop/Desktop Request)

mrsahilmir1
Giga Contributor

Hi everyone,
I'm working on a catalog item in ServiceNow titled "Laptop/Desktop Request". It includes several fields like radio buttons, text boxes, and lookup fields. I'm stuck on how to properly configure field dependencies.

Here’s what I need help with:

  1. Foundation Data Dependency
    For the field "Cost Centre", the dependency says:
    Data from Foundation data gathering. Autopopulate for the logged in user information.

How do I implement this kind of auto-population? Should I use a script or reference qualifier? Any examples would be super helpful.
Is this the correct approach? Any best practices I should follow?

I’ve attached the Excel file I’m working from: https://hclo365-my.sharepoint.com/:x:/g/personal/sonalisin_hcltech_com/EQflsfQzVkdCo3qUnbf_Jd8BqupHg... 

Thanks in advance for your guidance!

 

Sahil Gani Mir
2 ACCEPTED SOLUTIONS

@mrsahilmir1 

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

View solution in original post

Bhimashankar H
Mega Sage

Hi @mrsahilmir1 ,

 

If you want to auto populate the logged in username then you can use the below code snippet in default tab of that variable.

javascript:gs.getUserID()

It will auto populate the logged in user's name.

 

For any other auto populate you can either you use the other function or glide Ajax. For more information please go through the Autopopulate user details onChange of user name in Catalog Item post.

 

 

Thanks,
Bhimashankar H

 

-------------------------------------------------------------------------------------------------
If my response points you in the right directions, please consider marking it as 'Helpful' & 'Correct'. Thanks!

View solution in original post

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@mrsahilmir1 

for auto population you can use these options

1) variable default value supports javascript code

OR

2) onLoad client script + GlideAjax

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

@mrsahilmir1 

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

Bhimashankar H
Mega Sage

Hi @mrsahilmir1 ,

 

If you want to auto populate the logged in username then you can use the below code snippet in default tab of that variable.

javascript:gs.getUserID()

It will auto populate the logged in user's name.

 

For any other auto populate you can either you use the other function or glide Ajax. For more information please go through the Autopopulate user details onChange of user name in Catalog Item post.

 

 

Thanks,
Bhimashankar H

 

-------------------------------------------------------------------------------------------------
If my response points you in the right directions, please consider marking it as 'Helpful' & 'Correct'. Thanks!

Hi @mrsahilmir1 ,

 

I hope you saw my reply. 


If my response points you in the right directions, please consider marking it as 'Helpful' & 'Correct'. It will help future readers as well having similar kind of questions and close the thread.

Thanks,
Bhimashankar H