The CreatorCon Call for Content is officially open! Get started here.

Unable to fetch and set reference value using jelly

Streamline Cam
Tera Contributor

Hi! I am trying to take a field value from the form and use this to populate a field on a UI page with that value.

But it is not setting/getting the value. If i make my tags $[] I get a black reference value but if I use ${} I get no reference at all, I want to take the value from the record that is already populated.

<g2:evaluate var="jvar_cmdb_id" jelly="true">
        var val = current.getValue('cmdb_ci');
        val;
</g2:evaluate>

<g:ui_reference label="configuration_item" name="configuration_item" table="cmdb_ci" field="name" value="$[jvar_cmdb_id]" displayvalue="Testing" />
1 ACCEPTED SOLUTION

@Streamline Cam 

since you are in scoped app try this

<g:evaluate var="jvar_ci_sys_id" expression="RP.getWindowProperties().sysparm_ci_sys_id" />
                    <g:evaluate var="jvar_ci_display" expression="RP.getWindowProperties().sysparm_ci_display" />

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

10 REPLIES 10

Ankur! That worked - you genius! Thank you so much for all your support 🙂