title: LogicApp - The template language function 'contains' expects its first argument 'collection' to be a string. The provided value is of type 'Null'
body: <p>I have created an Azure Logic App with the Azure Service Bus Queue Trigger (When a message is received in a queue (auto-complete)) for re-processing dead letter queue messages.</p>
  <p>In the same Logic App, I’m validating the dead letter message with <strong>DeadLetterReason</strong> and <strong>DeadLetterErrorDescription</strong> properties values and then posting message to active queue.
  But for the few dead letter messages doesn’t contains the <strong>DeadLetterErrorDescription</strong> property name and value.</p>
  <p>Validation code in the logic app:</p>
  <pre><code> &quot;expression&quot;: {
                  &quot;or&quot;: [
                      {
                          &quot;equals&quot;: [
                              &quot;@triggerBody()?['Properties']?['DeadLetterReason']&quot;,
                              &quot;TTLExpiredException&quot;
                          ]
                      },
                      {
                          &quot;and&quot;: [
                              {
                                  &quot;not&quot;: {
                                      &quot;equals&quot;: [
                                          &quot;@triggerBody()?['Properties']?['DeadLetterReason']&quot;,
                                          200
                                      ]
                                  }
                              },
                              {
                                  &quot;not&quot;: {
                                      &quot;contains&quot;: [
                                          &quot;@triggerBody()?['Properties']?['DeadLetterErrorDescription']&quot;,
                                          &quot;NotFoundException&quot;
                                      ]
                                  }
                              }
                          ]
                      }
                  ]
              },
  </code></pre>
  <p>Error:</p>
  <blockquote>
  <p>InvalidTemplate. Unable to process template language expressions for action 'Validate_the_DLQ_message_reason_and_description' at line '1' and column '3467': 'The template language function 'contains' expects its first argument 'collection' to be a dictionary (object), an array or a string. The provided value is of type 'Null'.'.</p>
  </blockquote>
  <p>Validation logic:</p>
  <ol>
  <li>Need to be verify the <strong>DeadLetterReason</strong> and <strong>DeadLetterErrorDescription</strong> properties from Service Bus queue trigger properties.</li>
  <li>If the above properties exists, then I need to validate the values of those properties.</li>
  </ol>
  <p>So, please suggest me how to verify the above property name exists in the received dead letter message or not.</p>