Doc ID Bulk Replace in Automations

Dear Mimoans,

When a document is saved the id changes eg.
laptop.local:8989/#/documents/571851672/1a58c17d…

The automations then don’t work because their path is the old doc id eg.
layerON(/api/v1/documents/824522264/layers/F547280…

I have to manually change all of these. Is there a way of using a variable of the doc id in the automations path so that whenever doc id changes we can bulk replace all these paths.

Perhaps I am missing something obvious!
All the best

Unfortunately it’s not obvious, but you can put in the layer ID only in the layerON() function call without the /api/va1/document-part:

layerOn(“BA868701-8131-49CB-8EDD-8C7E6E7CD60B”)

If you want to switch on a certain layer variant, you can write it this way:

layerOn(“BA868701-8131-49CB-8EDD-8C7E6E7CD60B/variants/E3F43107-6E64-492D-B1C4-59A5691D1428”)

I hope this helps!