title: Setting and checking null in Azure Pipeline YAML
body: <p>I'm trying to add an option to one of our YAML pipelines that allows a user to set which parts of the project will and won't be deployed. To do this, I'm setting variables based on a user's checkbox selection like so:</p>
  <pre><code> variables:
      - template:         variables.yml 
      - name: deliverStageOne
        ${{ if eq(parameters.DeliverStageOne, 'False') }}:
          value: ''
        ${{ if eq(parameters.DeliverStageOne, 'True') }}:
          value: 'STAGE_ONE'
  </code></pre>
  <p>The next part of the process takes all these variables as an array called dbNames and uses a for loop to process each with the same block of code:</p>
  <pre><code>steps:
    - ${{ each dbName in parameters.dbNames }}: 
      - ${{ if ne(dbName, '') }}:
        - powershell:               [powershell command]
  </code></pre>
  <p>The trouble I'm having with this is that the conditional inside the above loop never seems to work - it always evaluates to True.</p>
  <p>I've tried setting value to x and using</p>
  <pre><code>- ${{ if ne(dbName, 'x') }}:
  </code></pre>
  <p>And that evaluates to true, even when I've checked the value of dbName with echo and confirmed that it is x.</p>
  <p>So I figured that this was something to do with the way YAML handles strings, and since '' is clumsy syntax anyway, I thought it would be better and clearer to set it to null:</p>
  <pre><code>      ${{ if eq(parameters.DeliverStageOne, 'False') }}:
          value: null
  </code></pre>
  <p>Using this in an ne expression results in a compile error:</p>
  <pre><code>- ${{ if ne(dbName, null) }}:
  </code></pre>
  <p>And reading the documentation suggests I can just do:</p>
  <pre><code>- ${{ if dbName }}:
  </code></pre>
  <p>However, while the above compiles, it continues to treat the null as though it's a string 'null' and falls into th powershell step beneath.</p>
  <p>How can I set this up so that YAML recognises that I've created a null value, and checks for it successfully?</p>