title: Handle Multiple Conditions per Field - LWC Conditional Formatting
body: <p>I'm new here so hoping the title does well. I have something like this in my LWC -</p>
  <pre><code>//HTML
  &lt;template&gt;
  &lt;lightning-input name=&quot;field1&quot; type=&quot;checkbox&quot;&gt;&lt;/lightning-input&gt;
  &lt;lightning-input name=&quot;field2&quot; type=&quot;text&quot;&gt;&lt;/lightning-input&gt;
  &lt;lightning-input name=&quot;field3&quot; type=&quot;date&quot;&gt;&lt;/lightning-input&gt;
  &lt;/template&gt;
  </code></pre>
  <pre><code>//js
  var condition1 = true;
  var condition2 = false;
  </code></pre>
  <p>The logic may be something like this:<br><br>
  <strong>Field1</strong> - IF condition1 = true AND condition2 = false<br>
  <strong>Field2</strong> - IF condition1 = true OR condition2 = false<br>
  <strong>Field3</strong> - IF condition1 = false AND condition2 = true<br><br></p>
  <p>My best guess would be to have a single function that does something like</p>
  <pre><code>assignFieldVisibility() {
  if (condition1 = true &amp;&amp; condition2 = false) {
  this.field1isVisible = true;
  }
  ...//all the other fields
  }
  </code></pre>
  <p>Then have a template wrap each field in the html pointing to the corresponding &quot;isVisible&quot; variable. <br><br>I just wanted to check and see if this is the right way to do it. There are 20 or more fields that I need to apply this sort of thinking to with more than 2 conditions at times. It felt rather bulky to have a function with 20+ if statements and a template around each field. Any advice on a better way to manage this conundrum would be greatly appreciated.</p>