(solved) Markdown configuation

Good morning from Germany,
I have some problems with the markdown listing, the entities under the ‘group.all_diesel_sensors’ are around 30, but the list I want to output should only contain around 10. The background to this is that there is only one gas station within a radius of 3 km, if I then expand the radius until an additional one is displayed, there are then about 30 gas stations, I am aware of this because of my location, hence the desired abbreviated output
I

type: markdown
content: >-
  # Diesel: {% for entity in expand('group.all_diesel_sensors') |
  sort(attribute='state') | map(attribute='entity_id') | map('string') | list %}
    {{state_attr(entity, "station_name")}}
    ## {{states(entity) }} €
    ***
  {% endfor%}

Is there a way to reduce the output, Something like this?

| map(attribute='entity_id') | map('string') | list [:10:] %}

Does changing how you’re using the list filter work?

list[0:10]

If i change to
list[0:10]
I get zero output

Put


expand('group.auto_gruppe_temperatur') |sort(attribute='state')

into round brackets:


type: markdown
content: >-
  # Diesel: {% for entity in
 (
expand('group.all_diesel_sensors') |sort(attribute='state') 
)[0:10]
 | map(attribute='entity_id') | map('string') | list %}
    {{state_attr(entity, "station_name")}}
    ## {{states(entity) }} €
    ***
  {% endfor%}

(The paragraphs are of course not necessary, they only help to clarify.)

Thank you, that works, I didn’t know that.

No problem!