title: Using context value in a Node-RED switch node
body: <p>I'm using the Switch node in Node-RED to determine if I should batch upload a buffered array <em>(which is stored in a context object)</em>.</p>
  
  <p>I would like the property to be <code>flow.batchData.length</code>, and the condition to be<code>&gt;= 100</code>.</p>
  
  <p>If I select the property type to be <code>flow.</code>, and set the property value to be <code>batchData</code>, I can't then access the <code>length</code> attribute of the array.</p>
  
  <p>I tried using a Javascript expression property type, but the following value didn't work: <code>flow.get("batchData").length</code>.</p>
  
  <p>How can I use the length of an object stored in context in a Switch node?</p>
  
  <hr>
  
  <p>Exported Node here:</p>
  
  <pre><code>[{"id":"de5265d5.0f7408","type":"switch","z":"157e7444.ffccac","name":"Should upload?","property":"flow.get(\"batchData\").length","propertyType":"jsonata","rules":[{"t":"gte","v":"100","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":820,"y":620,"wires":[["410db161.d497b"]]}]
  </code></pre>