{changed:item_id}

Description

Returns the list of field IDs that changed during an item's most recent edit, joined by dashes (for example category.......2-expiry_date.....). It reads the change-history record AA writes whenever an existing item is saved. Pass the long (32-character hex) item ID, usually the current item via the _#ITEM_ID_ alias. Returns empty when the ID is missing or not a valid item ID, when the item was only created and never edited (history is recorded on update, not on insert), or when the item's slice has history logging turned off. The last-edit diff always ignores the internal last_edit....... field. The typical use is inside item events and e-mail notification templates - test the result with ifin (one field) or intersect plus ifset (any of several fields) to act, or mail, only when the fields you care about changed. Related: changedate (when a field last changed) and history (a field's earlier values).

Parameters

item_id required

The long (32-character hexadecimal) ID of the item whose last-edit change list you want. A common source is the current item ID alias, written _#ITEM_ID_ . An empty value, or any string that is not a valid 32-char hex item ID, yields an empty result.

Examples

test[{changed:}]
Expected[]
Actual[]
No item ID, so no result. The square brackets only make the empty output visible; on its own the command returns nothing.
test[{changed:not-a-valid-id}]
Expected[]
Actual[]
Only a real 32-character hexadecimal item ID is accepted. Anything else - here the literal text not-a-valid-id - is treated as no item and returns empty.
virtual{changed:5726c2c6b035d7aab450d1794e9e90d7}
Expected(dash-joined ids of the fields changed in the item's last edit)
Actualmoved2active....-status_code.....
Pass a real item ID and you get back the field IDs that differed in that item's most recent save, joined by dashes. The result depends on the item's actual edit history, so it is shown here as an illustration. An item never edited (only created), or one on a slice with history logging turned off, returns empty.
virtual{ifin:{changed:5726c2c6b035d7aab450d1794e9e90d7}:expiry_date.....:Expiry date was changed}
Expected(Expiry date was changed)
The everyday use: do something only if a particular field changed. ifin checks whether expiry_date..... is in the changed list and, if so, emits the text. Replace the literal item ID with the current item, _#ITEM_ID_, inside an item event or e-mail template.
virtual{ifset:{intersect:{changed:5726c2c6b035d7aab450d1794e9e90d7}:category.......2-expiry_date.....}:relevant fields changed}
Expected(relevant fields changed)
intersect keeps only the IDs present in both lists, so the output is non-empty when at least one of category.......2 or expiry_date..... changed; ifset then emits the text. Because AA sends no notification when a mail body is empty, this pattern mails only on relevant edits.
virtual{count:{changed:5726c2c6b035d7aab450d1794e9e90d7}}
Expected(2)
Actual2
changed returns a dash-separated list, so count reports how many fields were touched in the last edit. Zero when the item was never edited or history logging is off for its slice.