Run Automate via an Action

I want a user to be able to press a button in Workshop which runs Automate over my object type ie not just on one object. I am assuming an Action linked to a button will achieve this but I cannot figure out how to link the Action to Automate (Automate only seems to have a manual execute option). Or does this need to be done via some other method, e.g. a Typescript function? AIP Assist is not quite getting what I am after.

hey @robind!

Automate is meant to be used when you want an Action, AIP Logic function, or Notification to run automatically (or, more specifically, triggered by some monitored criteria).

It sounds like the main part of your question has to do with executing some Action on the entire object set of a given object type. One way to do this could be through a Typescript function. You would, in the function, load all objects of that type using something like

const allObjects = Objects.search().MY_OBJECT_TYPE().all();

and then perform your logic on all of those objects.

Another way to do that from Workshop would be to create an object set variable in the workshop application that is the entire object set of a given type and then pass that object set variable as a parameter to your action.

Let me know if that solves what you’re after, or if you were asking something different.

1 Like

@robind Automate has quite a lot of options for running under different conditions, see various examples in the docs, but that includes when there have been changes on other objects, or sets of objects.

Then yes, like @rponnekanti says, you could create a function that takes no inputs, but searches for a set of objects (perhaps all of them) and using a .forEach() of that object set you could apply your changes to multiple objects.