check Field is empty

Nadia Tahir asked on May 23, 2018 12:23

hello devs i have to check if field is empty i use xml transformation and my macro like but its not working i just want check if exist any help thanks:

 {% if(JobLink != null) { %}

                 <span class="news"><a class="news" target="_blank"  href="{%JobLink%}">view this job </a><i class="fa fa-angle-right"></i></span>

                         {% } #%} 

Correct Answer

David te Kloese answered on May 23, 2018 13:07

Hi,

I guess JobLink might not return as Null but an empty string?

Try using something like: {% string.IsNullOrEmpty(JobLink) ? "" : "Value:" JobLink %}

0 votesVote for this answer Unmark Correct answer

Recent Answers


Nadia Tahir answered on May 23, 2018 13:52

thank you David

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.