Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Calling UI Macro

KiranmaiP
Tera Contributor

Can we  call and print a specific g2 evualate value from parent UI Macro to child UI macro, if yes please provide the syntax to call 

2 REPLIES 2

Deepak Negi
Mega Sage
Mega Sage

Hi

 

Can you try this
Parent Macro

<g2:evaluate var="currentUserName" expression="gs.getUser().getFullName()" />
<!-- Pass the value to the child macro -->
<g2:invoke macro="child_macro" currentUserName="${currentUserName}" />

 Child Macro

<j2>${currentUserName}</j2>

KiranmaiP
Tera Contributor

Please suggest another approach. This is giving error : Avoid Dynamic JEXL Expressions in an Evaluate