Simplify Rule Help

I have a dashboard with several tiles that effectively pause alerts for x, y, and z minutes. I have one rule for each tile which seems inefficient. Is there a way to use a single rule to accomplish the same thing?


Yes, you can use a single rule and send parameters to it using the special $.runRule hyperlink syntax.

Then you can use Context Variables to grab those parameters and react accordingly within your rule (they are accessed like HTTP Trigger parameters).

1 Like

Wow I was able to trim ~10 rules down to 1 with that trick just on my “alerts” related rules. I see a lot of other rules I’ll be able to simplify too.

Here’s what I did:

I set the URL on the tiles to $.runRule("18AMxxxxxxxw27", {"pause": 300})

If $context.event.params.pause = -1 then enable the alerts.
If $context.event.params.pause = 0 then disable the alerts.
If $context.event.params.pause > 0 then disable the alerts for x seconds.

Good stuff!

1 Like