Scope when invoked from a scheduled Action is empty

We have an scheduled Action which invokes an Analysis every 3 minutes. However, it looks like the scope is empty. Even when a tag is added to the Action, the scope is still empty.

We need to be able to detect in the analysis which Action invoked it.

Please help.

Hi @sanimesa,
The action ID is sent to the analysis in the enviroment variables. That means you can get the action info parameters by using it’s ID.

Would be something like this:

const env = Utils.envToJson(context.environment);
const account = new Account({ token: env.account_token });
const action_info = await account.actions.info(env._action_id);
context.log(action_info );

Hi Vitor,

Thanks it worked for me, what is the philosophy behind when something is in env vs scope?

Another quick question – I am trying to add an action that is triggered by a variable on blueprint devices. But it appears I can add only one tag while the message (please see attached image) suggests multiple tags can be added.

Can you please tell me if there is a way to add multiple device tags as criteria for actions?

Thanks.

Hi @sanimesa,
The scope is always related to the “data” that triggered the analysis.
The environment variable is the context which the analysis was triggered. It can contain action information, widget and dashboard information.

There is no way to add multiple tags to an Action. If more than one tag is needed, you can only do it by creating different actions…