Invoking another Analysis

How can we invoke one Analysis from another? Is there a way to add our own utility functions to multiple Analysis?

Thanks.

Hi @sanimesa,
Yes you can run another analysis from your analysis.

const scope = [{ variable: “temperature”, value: 12 }]
account.analysis.run(analysis_id, scope);

The only requirement for the scope parameter is that it need to be an array. That means you can run another analysis by sending an array of anything you want.

Example:

const scope = [1,2,3,4,5]
account.analysis.run(analysis_id, scope);

1 Like

@vitor Thanks, that’s exactly what I was looking for.

Hi @vitor One more quick question, can the Analysis return a value? Does not look like the run method has a return value.

It returns success or failure (like if the analysis ID was not found).