How to auto populate the logged in user details in the catalog item.

Naresh44
Giga Contributor

Hi,

I have created a catalog item with variables requestor, title, location, email id and phone number.

Requirements : 1)  Have to auto populate the  logged in user details by using the requestor variable.

                         2) How to change the visibility of a catalog item to itil

                         3) How to add the approval level 1 as - requestor manager and approval level 2 as the manager of the

application - security team.


Please help me in this regard.

 

Thanks & regards

Naresh Uppu

 

 

 

1 ACCEPTED SOLUTION

Namrata Khabale
Giga Guru

Hey Naresh,

To auto populate the  logged in user details:

Add in default value to that variables : javascript:gs.getUserID()//name of logged in user.

javascript:gs.getUser().getRecord().getValue('phone_number');//phone number

javascript:gs.getUser().getRecord().getValue('location');//location

AS shown in Screen shot:

find_real_file.png

 

TO change the visibility of a catalog item to itil 

GO to Available for

click on Edit

Select itil user.

Screenshot will help you:

 

find_real_file.png

 

 For sending Approval to Requester  Manager create a workflow

Drag and Drop Approval User activity.

In that advance Script write:

var answer=[];

answer.push(current.variables.u_name.manager);

u_name is field name put  your requester filed name.

 

AS shown in screen shot:

find_real_file.png

 

Mark Correct if this solves your issue and also mark  Helpful if you find my response worthy.

 

 

 

 

Thanks,

Namrata

 

 

View solution in original post

6 REPLIES 6

Swapnil Soni1
Giga Guru

Hi,

For scenario 1 you can use this-

You can create a onChange catalog client script  and use this script-

function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}

var name=g_form.getReference('requested_for_name').email;
g_form.setValue('requested_for_email',name);
var loc=g_form.getReference('requested_for_name',setLocation);
function setLocation(loc)
{
if(loc)
g_form.setValue('requested_for_location',loc.location);
g_form.setValue('requested_foe_department',loc.department);
}

//Type appropriate comment here, and begin script below

}

 

For 2nd scenario -

Look for Maintain items >> Name_of_standard_change & add Available for Not Available for related list option. This is on Catalog form for Standard Change & not Standard Change template form.

for 3rd scenario-

For approvals you can use Workflow for that.

 

Please mark correct or helpful if this helps you.

Thanks

Swapnil

Bhagyashri Sort
Kilo Guru

Hi,

You can pass the default value field of the "Requestor" variable dictionary form

javascript:gs.getUserID();

 

 

Please make it correct or mark it useful if your query is get resolved by this.