How to get current value in UI page

ramesh_r
Mega Sage

Hi All,

 

I have UI page and i am calling the UI page from UI action in RITM Table and i want to display some of the value in the UI page when its open

i am using the below syntax to get the value from current form but its not working. provide me the current syntax

 


Number: $[current.getValue('number')]<br/>
Priority: $[current.getValue('priority')]<br/>
Impact: $[current.getValue('impact')]<br/>
State: $[current.getValue('state')]<br/>

 

<g2:evaluate var='jvar_id'>
var val = current.getValue('number');
val;
</g2:evaluate>
$[jvar_id]

 

<g2:evaluate var='jvar_id'>
var val = current.getValue('number').toString();
val;
</g2:evaluate>
$[jvar_id]

3 REPLIES 3

Maik Skoddow
Tera Patron
Tera Patron

Hi @ramesh.r 

please see https://community.servicenow.com/community?id=community_question&sys_id=34574369db1cdbc01dcaf3231f96.... The answer for your question is described there.

Kind regards
Maik

If my answer replied your question please mark appropriate response as correct so that the question will appear as resolved for other users who may have a similar question in the future.

Hi @ramesh.r 

Did my reply answer your question?

If so, please mark the appropriate response as "correct" so that the question will appear as resolved for other users who may have a similar question in the future.

If not, please tell me what you are still missing.

Many thanks & kind regards
Maik

Suvarna Deokar2
Tera Contributor

Hi, may this helps you

There is no default current object associated with a ui page, you need to pass in the sysid as a url parameter and then use gliderecord() to look it up and update it in the processing script or client script.

<g2:evalute jelly = "true">

      var id = RP.getparameterValue("sysparn_sys_id");

      var tb new GlideReocrd("Table_Name");

     if(tb.get(id))

    {

         //You can access your record here

    }

</g2.evaluate> 

<p> Number : $[tb.priority.getDisplayValue()]</p>

 

And for UI Action you can refere : 'https://servicenowguru.com/system-ui/glidedialogwindow-advanced-popups-ui-pages/'