How can I set a Lightning Component visibility based on text filed value = NULL. I have a text area field and I want to only display one component if Text area field contains value. I can't seem to be able to find documentation that explains checking value for NULL.

I have looked at this Article but that doesn't have information I need.

enter image description here

  • Do you want to render text area based on some user input> – Samir Feb 5 '18 at 17:09
  • @Samir Yes, That is correct. – Ricky Feb 5 '18 at 17:11

Use the empty string value '':

enter image description here

  • Just wondering as the answer of @Samir (the one below) can do the trick too, what will be best practice in general, using this filter or using the code <aura:if ... – manza Jun 14 '18 at 23:39
  • 1
    @manza Coding this in to the component means you have to deploy code each time you make a change. If all you want are filters, you probably want to do it this way. – sfdcfox Jun 14 '18 at 23:51

use <aura:if> to render the component based on the input of the text area. Pseudo code.

  <aura:attribute name="strTest" type="String"/>

  <aura:if isTrue="{!not(empty(v.strTest))}">
  //TRUE - show your component here
  <aura:set attribute="else">


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.