[IMPLEMENTED] Old and new values in rule triggers

Hi,

Is it possible to use old and new values in rule triggers for ContentChanged events? I can see that this data is available when writing scripts for custom workflows (e.g. ctx.oldData.status.iv) but can’t see an equivalent in the documentation for rules.

What I’d like to be able to do is to set up a rule which is only triggered when a user changes a particular field on a content item.

Thanks,
Helen

1 Like

Right now it is not possible, but I will convert this support request to a feature request.

Welcome to the Community, btw,

1 Like

Hi Sebastian,
Thanks for the welcome!

In the mean time, would there be any workarounds other than storing the value of this field outside Squidex and checking every time the rule is triggered by a content changed event? The rule would be used to put a message on an Azure queue.

Thanks,
Helen

The only option would be to have a json field or so and a script that populates the json field with the previous data.

1 Like

In which cases do you need the old data? Only for updates? Makes not so much sense for status changes or deletions.

Yes, I would just want to use it for content changed events, to examine the values before and after the update. It might be useful for other update events (e.g. asset renamed) but I don’t have an immediate use for those.

I can’t see a reason to have it on status change or delete - as you say, that doesn’t make much sense as the individual fields won’t be changed by that operation.

1 Like

HI, It has been implemented for the new content event in the master branch

1 Like

Wow, thank you! I’ll let you know how I get on with it.

Hi Sebastian,

This seems to do exactly what I wanted - thanks!

1 Like