Has anyone succeeded in working with response_variables?

In practice it doesn’t work. Passing response variables in the specified scope is still blank on the other side. So either the docs are wrong or there is a bug. In addition, what the community has been saying is this is simply not a workable paradigm, even if it did work as documented. Variables init’d outside of a branching scope should be lifted to the outer scope when set.

No, this 100% works if you keep it within the proper scope. I’m using it. Whatever you’re doing is not correct. Here’s a full example:

  - variables:
      calendar: calendar.xxx
  - service: calendar.get_events
    data:
      start_date_time: "{{ today_at() }}"
      end_date_time: "{{ today_at().replace(year=now().year + 2, day=1, month=1) }}"
    target:
      entity_id: "{{ calendar }}"
    response_variable: raw_events
  - variables:
      gathered: >
        {{ {'events': raw_events[calendar].events} }}

So please post your code. I’ll help you fix it.

EDIT: If you’re referring to this post:

If statements are a nested items. It won’t work with if statements, hence why you have to do…

So if the stop, which passes the response variable, is inside the conditional and the variable is populated inside of the same conditional it doesn’t pass the value. You’re saying this is by design?

Variables do not pass from inside a nested item to the outer layer.

e.g. this does not work.

- if:
  ...
  then:
  - variables:
       abc: 1
  else:
  ...
- variables:
    xyz: "{{ abc }}"

Yes, this is by design. That doesn’t mean it can’t change, just wasn’t implemented when variables were first introduced.

Thanks for clearing that up for me.