Automation Process - Using Macros to Exclude Actions Being Taken on Particular Contacts

Stephen Dickerson asked on March 20, 2014 13:13


I'm trying to create a macro condition to exclude certain contacts. I figure there are a couple of ways to do this.

I have two sites running on one instance; therefore I have site specific contacts and global contacts. Of course, some of these contacts are also users. I want to exclude global contacts from having an action applied to them if they belong to a particular organization that is not a "partner organization." This can be defined in the organization a contact belongs to (organization is a partner = true), so this may be the easiest way to accomplish this.

The other way I can think to accomplish this would be: the contact could have a user account that belongs to a particular role (Partner role).

I'm new to writing macros, so I'm having a hard time figuring out how to identify a contact's organization and determine whether it's a partner using macros in the automation process. Thank you for your help!

Recent Answers

Josef Dvorak answered on March 27, 2014 09:45 (last edited on December 10, 2019 02:30)


I was not sure what you mean by organization, we do not have such object in Kentico. If it is some custom object, you will need to create a Custom Macro Method to read it.

If you represent the organization using the Account object, you can read and filter them using its status in Macro. Here are some examples:

This macro will return true, if at least one of Contact Accounts is in status with codename "Partner":

{% OnlineMarketingContext.CurrentContact.Accounts.Filter("AccountStatus == \"Partner\"").Count > 0 |(identity)GlobalAdministrator%}

As you can see, these Macros work with OnlineMarketingContext.CurrentContact, so that you can test them on a Document first. When you pick one to be used in Marketing Automation Process, substitute OnlineMarketingContext.CurrentContact for just Contact.

Let me know if I can help you any further.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.