Custom block with a field value that can be used in other twig template I am creating a custom block with fields:

field_items_to_show (items to show)
field_logos (images, multiple)

The site editor must have the option to set the amount of items to show in a field.
in the twig field template field_logos I need the value from field_items_to_show
&lt;div class=&quot;logos-slide-out&quot;&gt;
    &lt;div class=&quot;more-less wrapper d-flex-new flex-column align-items-center&quot;&gt;
        &lt;div class=&quot;itemstoshow row d-flex-new&quot;&gt;
            {% for item in items %}
            {% if loop.index == 9 %} // this value must be set from field_items_to_show
        &lt;/div&gt;
        &lt;div class=&quot;more-content itemstohide row d-flex-new&quot;&gt;
            {% endif %}
            &lt;div class=&quot;item col-sm-3 mb-30&quot;&gt;{{ item.content }}&lt;/div&gt;
            {% endfor %}
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
In a field template you find the parent entity in the variable element['#object'], from where you can get field values of other fields:
{% set field_foo_value = element['#object'].field_foo.value %}