This widget could not be displayed.
This widget could not be displayed.

Service Portal auto populate fields after user name selected

Moedeb
Tera Guru

I have a requirement for a couple of fields to be populated with the appropriate information once a customer adds the name of the 'owner' of a dashboard - that persons email and department needs to then be added to the appropriate fields.

I have checked a number of forum posts similar, tried most of them and still can't get it to work, so here I am asking directly.

find_real_file.png

So based on the Owner name being added (which shows as the first name and surname - eg: Joe Bloggs) - note: it is almost certainly not going to be the name of the user entering the details.

owner_section would map to the 'Department' field

owner_email would map to the 'email' field

I believe all are available through sys_user

Also as a side question - is it possible to allow free text in a reference field if someone needs to enter something that is not available to select? 

If someone could let me know how to do this I'd certainly be grateful.

1 ACCEPTED SOLUTION

Can you make that variable as reference and refer to cmn_department table.

View solution in original post

23 REPLIES 23

Shweta KHAJAPUR
Tera Guru

Can you give more details about the field? are these fileds populated from widget or is this some catalog?

Sorry this is a catalog item - so a user chooses the owner name from the active user list in our instance.

You can use onChange catalog client script to populate remaining two.

Yes I realise that an on change script is the most likely answer, but I have not been able to get any of the scripts I've found on here to work, so I'm hopeful someone can provide me with the script I can use?