Can you tell how an action group was called?

Posted on
Tue Sep 19, 2017 8:35 am
racarter offline
User avatar
Posts: 468
Joined: Jun 18, 2016
Location: North Yorkshire, UK

Can you tell how an action group was called?

Idle curiosity I suppose, but might have uses: is there any way to tell whether an action group was called by a trigger or a schedule?

Posted on
Tue Sep 19, 2017 9:24 am
jay (support) offline
Site Admin
User avatar
Posts: 18200
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Can you tell how an action group was called?

Not at the moment. From an implementation standpoint we built the actions (and action groups) to be completely independent of any other objects. In hindsight, it would have been useful to be able to pass through data that would allow an action to know what caused it to be executed. This is definitely something that's on our request list for a future version, but it's a non-trivial task so we have no idea when we might get to it.

There is a workaround (albeit pretty hacky) - create an action per trigger/schedule that updates a variable with an identifier for the trigger/schedule and an action that just executes the common action group (perhaps with a slight delay to make sure the var has time to update). Anything in the action group would then have access to the variable which would identify how it was called. Definitely not perfect (race conditions might make this not work well) but it might work well enough for your purpose.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Tue Sep 19, 2017 10:15 am
racarter offline
User avatar
Posts: 468
Joined: Jun 18, 2016
Location: North Yorkshire, UK

Re: Can you tell how an action group was called?

Thanks Jay - that's interesting.

I have an action group that's scheduled to run twice a day, at 0900 and 2100, and I wanted it to do something slightly different if it was run from a trigger or manually. The action group just runs an external Python script, and on the basis that it would only be triggered manually during the day I decided just to put a time check in the Python script.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest