Use label_entities in picture card perform-action

End goal: dashboard with picture card that toggles a set of labeled switches

I’ve confirmed that the following does what I want in Developer tools > Actions:

action: switch.toggle
data:
  entity_id: "{{ label_entities('christmas_decorations') }}"

but my attempt to transcribe this into a a picture card doesn’t appear to do anything (no change in the switches, no errors in the logs that I can find):

type: picture
image: /api/image/serve/6424aac57250c1711e1acad3a7b3b9c1/512x512
tap_action:
  action: perform-action
  perform_action: switch.toggle
  data:
    entity_id: "{{ label_entities('christmas_decorations') }}"

Replacing label_entities(...) with [ 'switch.foo', 'switch.bar' ] works as expected.

I’m new to Home Assistant & assume this is just a newbie mistake, but any hints about what I’m doing wrong, or pointers to debugging tools/info, or additional doc I should read would be much appreciated.

Picture elements card does not support templates.
Create a script with a template, then call the script from the card.

Thanks for the pointer @Ildar_Gabdullin. If anyone runs across this in the future this is the bit of doc that I had missed.