how to display UI macro in change request form for specific user

balmansour
Tera Contributor

I have wrote this UI macro to display a small logo beside a field (u_external_reference) that links to an external website 

<?xml version="1.0" encoding="utf-8" ?>

 

<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">

<img src="some_logo.jpg" stype='width=1px, hight:1px' onclick="changelist()" title="{gs.getMessage('go to website'}">

</img>

<script language="javascript">

 

    function changelist(){

        

      

        var tableName='change_request';

        var url='some websit link';

 

        window.open(url,'_blank');

        return false;

    }

    </script>

        </j:jelly>

 

I want to display this UI macro to only one user how can i do that? any tips?

 

 

1 REPLY 1

Danish Bhairag2
Tera Sage
Tera Sage

Hi @balmansour ,

 

You need to apply an if condition in ur jelly script & write the code der for displaying it to a single user.

Pls check this link

https://www.servicenow.com/community/developer-forum/if-condition-in-jelly-script/m-p/2112663#M76958...

 

Thanks,

Danish