Create event in Google Calendar using Text Input from dashboard

Dear community,
I’m a HomeAssistant enthusiast and just started couple of weeks ago, please understand if I don’t explain myself completely. I’m currently trying to create an event in my calendar (synced with GCal) by using an input text row in my dashboard.

I have managed to successfully add an event using [Call Service: google.add_event], what I basically would like to do is to parse the input_text I write in the dashboard into the [Call Service: google.add_event].

I know I should be using a script, but I still haven’t fully understood how to. Any help is appreciated!
Below is my lovelace_card

[Lovelace UI card]

type: entities
entities:
  - entity: input_text.announcement_text
    type: custom:text-input-row
    id: row1
  - entity: input_text.announcement_text2
    type: custom:text-input-row
    id: row2
  - entity: input_text.announcement_text3
    type: custom:text-input-row
    id: row3
  - type: call-service
    name: 'Google Calendar '
    icon: mdi:calendar
    action_name: Add
    service: script.calendar_add

Which renders like this:

image

And this is the script I have tried to write, without any success. (Obviously)

alias: calendar_add
sequence:
  - service: google.add_event
    data:
      calendar_id: [email protected]
      summary: "{{ states.input_text.announcement_text1.state }}"
      start_date: "{{ states.input_text.announcement_text2.state }}"
      end_date: "{{ states.input_text.announcement_text3.state }}"
mode: single

Thanks in advance to anyone who can help!
Cheers

XZ

Try the following format:

{{ states(‘input_text.announcement_text1’) }}

Thanks for you reply.

Unfortunalely, it gives me the error:

Message malformed: template value should be a string for dictionary value @ data[‘sequence’][0][‘data’]

This is how I have added you suggestion to my script:

alias: calendar_add
sequence:
  - service: google.add_event
    data:
      calendar_id: [email protected]
      summary: "{{ states(‘input_text.announcement_text1’) }}"
      start_date: "{{ states(‘input_text.announcement_text2’) }}"
      end_date: "{{ states(‘input_text.announcement_text3’) }}"
mode: single

Any suggestion is welcome, thanks!

Drop the speech marks maybe :man_shrugging: