1

Is there a way to start an automation via AMPScript API within a landing page?

I tried the following and it throws an error that the automation is deleted

. However, the automation is not deleted.

%%[

   SET @automation = CreateObject("Automation")

   SetObjectProperty(@automation , "CustomerKey", "CT_Offers")

   SET @auto_statusCode = InvokePerform(@automation, "start", @errorCode)  

]%% 
2

1 Answer 1

1

In order to perform an Automation object, it requires passing in the ObjectID instead of the CustomerKey. If you need to get the ObjectID then InvokeRetrieve can be used.

With Retrieve, it is kind of odd because the property that has to be specified is "ProgramID" even though in the response it is called "ObjectID". Basically 2 names for the same field just depends on the context as to which it wants.

3
  • Is this on the help wiki somewhere? If not, it should be. Jun 17, 2015 at 16:34
  • For Automations created in the UI, you can also put in a call to Global Support and they can retrieve for you if you would rather avoid creating the InvokeRetrieve block. Jul 2, 2015 at 17:39
  • Please see my updated results on this topic here - salesforce.stackexchange.com/questions/377504/… Jun 2 at 16:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.