Populate Reference Variable Based on Another Variable Selection in Service Catalog.

manishtyagi
Tera Contributor

Hi Community, I’m working on a Service Catalog item and need some help with a dynamic reference field. I have two variables Department and Doctor (Reference) When a specific department is selected, the Doctor variable should only display doctors who belong to that selected department. Can anyone guide me on how to achieve this? Should I use a Reference Qualifier or a Catalog Client Script?

2 ACCEPTED SOLUTIONS

GlideFather
Tera Patron

Hi @manishtyagi 

let's go with a reference qualifier on the Doctor variable.

 

Try something like:

javascript: 'department=' + current.variables.department

 

EDIT: Please note that's automatica transcript, it shall be "javascrip t :" (no spaces) not javascript:

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */


View solution in original post

mayankkumar
Tera Sage

Hi @manishtyagi,
----------------------------------------------------------------------------------------------------------------------------------------------------
Yes, you can definitely achieve this using Reference Qualifier (Advanced)
and you can write it like ->

javascript: "u_department="+current.variables.department //replace the variable names with your original ones.

Now what it will do is that it will fetch the only doctors which belonged to the selected department
If you need further help do let me know.
--------------------------------------------------------------------------------------------------------------------------------------------------
Please mark my response Helpful and Accept as solution
Thanks & Regards
Mayank

View solution in original post

9 REPLIES 9

@mayankkumar I see that it was posted at similar time, i meant it was both similar so i agree with you. Sorry if it turned out different way i have been multitasking.

 

it was just for the “u_”, otherwise agree in full but perhaps it will be completely different anyways, the author will know better

 

apologies 🙌 

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */


Hi @GlideFather,

No worries at all and really! I just meant to clarify things from a technical point of view. Nothing was meant to sound rude or personal😀.

Totally understand how things can come across differently. All good, and happy to collaborate anytime!


you can go through this -> Name conflicts may be introduced by new OOB fields if a custom field having same name has been creat...
to understand more about "u_".
Feel free to correct me if I’m wrong.
-------------------------------------------------------------------------------------------------------------
Thanks & Regards
Mayank

OK OK @mayankkumar thank you very much for sharing the article, I will bookmark it for future references 🙂 have a wonderful day!

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */


Btw Nice Username Kamil @GlideFather 😜

 

@mayankkumar Thanks 😁😁😁

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */