How to autopopulate catalog item variables using sys_user table

User163016
Tera Contributor

I have a request form that needs to auto populate 4 variables based on the user that opened the request.   The 4 fields are Project owner name, title, department and phone.   These are all fields that exist in the sys_user table.   I read through several discussions and found different variations on how to accomplish this, some of them with catalog client scripts but so far I have been unsuccessful with these suggestions.   Bhavesh Jain did suggested in a post to use javascript:gs.getUser().getFullName() in the default value field for name and that worked perfectly, but I'm unable to figure out how to get this to work for the other three fields.   Any help is appreciated.

Thanks,

1 ACCEPTED SOLUTION

Hi Chad,



I've attached a simple script include and client script that should do the job for you. You will   need to update the catalog client script to the right Catalog Item.



Check the field variable names, but I think you'll find it's all there.


View solution in original post

24 REPLIES 24

Thanks so much for your guidance on this!!!   This is a great learning experience for me.



I will spend this afternoon adding gs.log statements and report back as soon as I can on my findings.


Sorry for the delayed response.  



Thanks Chuck, the scripts you provided worked...I appreciate your time and effort!


Glad you got it working Chad


HI Thomasi,



I am looking for autopopulation in catalog items,The attachments which you have shown is not openning in my system,


Can you please send the Screesorts of Script Include and Catalog Client Script.



Thank you in advance.



Regards,


vardhini.


Hi Raja,



Download the XML files attached earlier in this thread.


From any list, use the list menu to import XML for each file.


You will then find the client script and script include in their respective lists.