Using input_text as variable

Hello, I have setup Discord notifications and I need to always specify the channel id as a target for the notification, I thought would be best practice to keep the channel id in an input_text helper and reference that in the “target” for the notifcation, but I’m not sure how to use it as a variable…

I tried this but it doesn’t work:

action:
  - service: notify.hass
    data:
      target: {{ input_text.discordchannelid }}
      message: Test

Try states("input_text.discordchannelid") instead of input_text.discordchannelid

1 Like

You’ll need to quote the template:

target: "{{ states('input_text.discordchannelid') }}"
1 Like