Output first matching matrix block model if condition is true I've run into situation, where I have to loop only once, if condition has met the requirements. The condition is controlled by matrix block field ligthswitch which is the field in finish.

Matrix structure:


Actually, I've ended up doing this:

{% for block in entry.productSettings.type('finish') %}
   {% if block.inStock %}
      {{ block.amazonUri }}
   {% endif %}
{% endfor %}


which outputs cluster of characters: 123456.
Bear in mind, that total count of characters is count of loops. Desire output is 1.
Can't something like this help you?

{% for block in entry.myMatrixField.type('fruits').ligthswitchField(params) %}