How to retrieve variable value from catalog

Deepa12
Tera Contributor

Hi,

 

I have submitted request into service portal with all the details, but the while retrieving the value into request\request ITEM. the only field didnt fetch the value and showing blank. how to fix this issue.

THanks.

4 REPLIES 4

Community Alums
Not applicable

Hi Deepa,

If client side, the standard g_form.getValue('<fieldname>'); should return the value. 

If in a workflow / server-side you would want to use current.variables.<fieldname> to return the current value.

Mark my answer correct & Helpful, if Applicable.

Thanks,
Sandeep

var requestItem = new GlideRecord('sc_req_item');
    
    requestItem.addQuery('cat_item.nameSTARTSWITHPrinter ');
    requestItem.addEncodedQuery('number='+current.number);
    requestItem.query();
    while(requestItem.next())
        {
            
            
            gs.addInfoMessage(requestItem.variables.queue_name.getDisplayValue()); //this value displaying info message
            
            current.variables.queue_name.SetDisplayValue(requestItem.variables.queue_name.getDisplayValue()); //but it didnt display into the field Queue Name.
                        
        }

Saurav11
Kilo Patron
Kilo Patron

Hello,

Can you share the script you are using it would be easier to assist you.

Thanks.

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

Seems there is some client script or UI policy which is running on RITM level and clearing the value

Did you debug that?

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader