Forum Discussion
NickCharalambou
2 years agoQrew Cadet
OK I have updated as follows as I realised the opening string was incorrect and simply blank.
However it still not working.
{# Capture the initial detail value that is passed into the template #}
{% set initial_detail = g.detail %}
{# Initialize a list starting with the initial content of j.detail #}
{% set messages = [initial_detail] %}
{# Check if the requested offer types have changed and append a message if true #}
{% if a.requested_offer_types != a.$prev.requested_offer_types %}
{# Create a message about the change #}
{% set message = "Requested Offer Types changed from '" + a.$prev.requested_offer_types + "' to '" + a.requested_offer_types + "'" %}
{# Append the message to the messages list #}
{% set _ = messages.append(message) %}
{% endif %}
{# Output all accumulated messages, including initial and new ones, separated by new lines #}
{{ messages | join('\n') }}
I think the join is wrong.