If statement in UI Macro

Prasad43
Tera Guru

Hello folks, I want show a hyper link if value is not empty. Can you please help me to correct the below script.

 

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
        <j2:set var="jvar_source_wid" value="$[current.getValue('u_souce_id')]" />
<j:if test="${jvar_source_wid !=''}">
<div style="text-align:center;">
    <a href="https://wd3.myworkday.com/sourceid/$[jvar_source_wid].htmld" target="_blank">Open Workday Profile
    </a>
</div>
</j:if>
</j:jelly>

1 REPLY 1

Shree3
Tera Expert

Hi Prasad,

The syntax for if else in a UI macro is like this :

<j:if test="condition" >

<!-- your code here -->

</j:if>

Please follow this thread it may help you :

https://community.servicenow.com/community?id=community_question&sys_id=96b487e9dbd8dbc01dcaf3231f96...