Gliderecord query in <g:evaluate> overwriting and displaying the previous object values by the last one in while "jelly script" (<j:while test="\${jvar_Visible.next()}">),though loop is running correctly.

soumalyasnow
Kilo Contributor

I have designed a ServiceNow UI Page where I have used Glide Query in <g:evaluate> tag mentioned below -

<g2:evaluate var='jvar_Visible' object='true'>

        var FirChild = new GlideRecord('u_requested_action_details');

          FirChild.addQuery('u_request_detail',sourceiID);

    FirChild.query();

  gs.log('soumalya'+FirChild);

  FirChild;

</g2:evaluate>

and then run a while loop jelly script under it -

<j:while test="${jvar_Visible.next()}">

  <g:ui_table>

  <g:ui_header>Child Preview</g:ui_header>

  <table>    

  <th>Position Classification</th>

  <tr>

  <td >

                  <label>$[FirChild.u_po_country.getDisplayValue()]</label>

      </td>

    <td colspan="2">

                  <label>$[FirChild.u_po_city.getDisplayValue()]</label>

          </td>

    </tr>

    <tr>

  <g:ui_table>

Now suppose if the while is running for 2 times
it is creating the two Child Preview section marked in Red,but displaying the last child (in this case second child) information for both the child values.

If the loop is running for 3 times,it will create 3 child sections.but all are displaying last child(3rd in this case) information.Details coding and screenshot attached.

So is it overwriting the previous child information with the ;latest one,or what is happening here?
and how can I resolve it?

7 REPLIES 7

Gurpreet07
Mega Sage

Replace FirChild with jvar_Visible and check.


i mean in while loop.


soumalyasnow
Kilo Contributor

Thanks to Gurpreet.
But its not working buddy. Now it is not fetching any information of the child
fields are showing blank


Change the jelly tag for while from phase 1 to 2