[IMPLEMENTED] Rules > Formatting

I’m having trouble to include usefull information in the Webhook of a rule, when ASSETs are changed.
I need this because I have to delete my asset cache when one assets is changed. But I want to delete one cache file, not all, when one assets is changed, so I need to identify the asset changed.

For CONTENT there are usefull parameteres:

But it seems there are no similar parameters for ASSETs.
I tried including in the Webhook Payload the following, none of which was replaced by a value:
$FILENAME, $TYPE, $ASSET_URL, $ASSET_ACTION, $SLUG, $NAME, $ASSET_NAME, $ASSET_SLUG
I also tried putting this in the Payload, but returned null: Script(${contentUrl()})

Are there parameters to identify the asset beeing changed in the webhook?

Thanks!

Environment

  • [X ] Cloud version

Not yet, but you can use scripting for almost anything.

But your sample is not valid javascript…

needs to be

Script(`${contentUrl()}`)

Hi,
I have generalized this and with the $CONTENT_ or $ASSET_ notation you have full access to all properties now and I also added $ASSET_CONTENT_URL as a special case.

Will be deployed soon.

But if you use a webhook I would just keep the formatting empty, then you get the full event with all properties.

Not deployed yet, will update the feature request when it is done

Thanks for the answer. I left the Payload empty and was able to parse the event.

The update will be very good, please dont forget to update the docs. Also, the fact that an empty payload sends the whole event structure.

The description mentions it: “The optional custom request payload.” … Obviously it is not good enough.

Hi, I have deployed that and updated the docs: https://docs.squidex.io/02-documentation/developer-guides/rule-formatting

Found a few issues while writing the docs, but it will be deployed soon.