Using Fields in the UI Script Editor

With the new automation and script changes in 0.113 I am trying again to convert my YAML files to the UI. I have the following script courtesy of Dr. Zzs;

activate_alexa_actionable_notification:
  description: 'Activates an actionable notification on a specific echo device'
  fields:
    text:
      description: 'The text you would like alexa to speak.'
      example: 'What would you like the thermostat set to?'
    event_id:
      description: 'Correlation ID for event responses'
      example: 'ask_for_temperature'
    alexa_device: 
      description: 'Alexa device you want to trigger'
      example: 'media_player.study_dingus'
  sequence:
    - service: input_text.set_value
      data_template:
        entity_id: input_text.alexa_actionable_notification
        value: '{"text": "{{ text }}", "event": "{{ event_id }}"}'
    - service: media_player.play_media
      data_template:
        entity_id: "{{ alexa_device }}"
        media_content_type: skill
        media_content_id: amzn1.ask.skill.89ba8a0b-04b5-42a3-a80a-dfa2a76ecd10

Firstly, I don’t see a way in the UI to set the fields so I have just added that into the scripts.yaml file manually. But then when I try to add the input_text.set_value and 'media_player.play_media` although the UI accepts them and the configuration check passes, when I try to run the script I get the following error;

Failed to call service script/activate_alexa_actionable_notification. extra keys not allowed @data['data_template']

Here is the section from scripts.yaml;

activate_alexa_actionable_notification:
  alias: Activate Alexa Actionable Notification
  mode: single
  description: Activates an actionable notification on a specific echo device
  fields:
    alexa_device:
      description: Alexa device you want to trigger
      example: media_player.study_dingus
    event_id:
      description: Correlation ID for event responses
      example: ask_for_temperature
    text:
      description: The text you would like alexa to speak.
      example: What would you like the thermostat set to?
  sequence:
  - data:
      data_template:
        value: '{"text": "{{ text }}", "event": "{{ event_id }}"}'
    entity_id: input_text.alexa_actionable_notification
    service: input_text.set_value
  - data:
      data_template:
        entity_id: '{{ alexa_device }}'
        media_content_id: amzn1.ask.skill.89ba8a0b-04b5-42a3-a80a-dfa2a76ecd10
        media_content_type: skill
    service: media_player.play_media

Can someone please point out where I am going wrong here? I’ve tried shifting around the data/data_template to try and nest them but struggling to understand how to get the template/field for {{alexa_device}} to be recognised (I’m guessing this is where the error is rather than in the input_text.set_value section as that seems to make sense to me).

It’s either data or date_template, you don’t use them together.
If you have a template in any of the fields -> use data_template, otherwise use data.

May I ask,
Whilst you presumably have working yaml automations and scripts,
You want to move them to the gui ?
There have been numerous threads discussing how this feature or that method is not yet supported in the gui.
I am truly intregued.

I’m trying to see if the features and methods I use are supported. If they’re not I’ll just change one line in my configuration and switch back. I’m not sure how else I would test what is or is not supported in the GUI.

I’ve tried just using data/data_template and still getting errors. It seems you don’t actually need ‘data_template’ with all templates as my wakeup script uses a multitude of templates in the message to notify.alexa_media and this works fine.

Message instructions have always accepted templates,
There is no message_template: key

You ‘may’ find (going forward) that this type of flexible key will be utilised more frequently. Some of them in the new structures will probably be played down until the gui editor can catch up.
:man_shrugging: