Forum Discussion
SeanConnaughto1
4 years agoQrew Cadet
You could do something like this:
{%- set audit_list = [("field one name" ,a.fieldone, a.$prev.fieldone),("field two name" ,a.fieldtwo, a.$prev.fieldtwo),("field three name" ,a.fieldthree, a.$prev.fieldthree)] -%}
{% for i in audit_list -%}
{% if i[1] != i[2] %}
Field Changed: {{i[0]}}
--- New Value: {{i[1]}}
--- Old Value: {{i[2]}}
{% endif %}
{%- endfor %}
------------------------------
Sean Connaughton
------------------------------
{%- set audit_list = [("field one name" ,a.fieldone, a.$prev.fieldone),("field two name" ,a.fieldtwo, a.$prev.fieldtwo),("field three name" ,a.fieldthree, a.$prev.fieldthree)] -%}
{% for i in audit_list -%}
{% if i[1] != i[2] %}
Field Changed: {{i[0]}}
--- New Value: {{i[1]}}
--- Old Value: {{i[2]}}
{% endif %}
{%- endfor %}
------------------------------
Sean Connaughton
------------------------------