SOLVED

How to get my smart campaign to ignore triggers outside of business hours

Go to solution
jnkrochman
Level 2

How to get my smart campaign to ignore triggers outside of business hours

I have a campaign that I want to to trigger every time an acceptable action occurs, but once it hits 5pm, I want it to ignore all triggers (not delay them) until 9am the next day, where it will then resume, and trigger based of acceptable actions until 5pm again. How can I achieve this?

1 ACCEPTED SOLUTION

Accepted Solutions
jnkrochman
Level 2

Re: How to get my smart campaign to ignore triggers outside of business hours

Thank you for your suggestions. I use your suggestion as inspiration for my ultimate solution, you can see my copy and paste response to another individual below. Thank you for your inspiration!

"The use case is to post to a webhook connected to a google chat space when a specific criteria of lead is created in salesforce, but only during business hours.

What I ended up getting to work was inspired by the suggestion by @SanfordWhiteman. I created a formula field in salesforce that calculates the business hours in a true false statement on the lead level, when inside business hours, the checkbox is marked true, when outside of business ours, the checkbox is not marked. Then I have the trigger campaign in marketo run with a filter that checks for the true false statement, if true, it fires, if false, it does not. "

Here is the formula used in the true false field within salesforce in case anyone in the future needs this. Note: salesforce runs in GMT, so adjust the timevalues accordingly. Also, if your local timezone does daylight savings, this will need to be adjusted with the time change. I am in AZ where we do not, so for my use case this should fine year round.

IF(
AND(
WEEKDAY(Today()) > 1,
WEEKDAY(Today()) < 7,
OR(
TIMENOW() > TIMEVALUE("16:00:00.000"),
TIMENOW() < TIMEVALUE("00:00:00.000"))), true, false
)

View solution in original post

11 REPLIES 11
Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: How to get my smart campaign to ignore triggers outside of business hours

There's Local Asset Expiration to Deactivate the trigger campaign, but it doesn't have the option to auto-schedule the recurring activation/deactivation of trigger campaigns. You can activate and deactivate trigger campaigns at 9 AM and 5 PM respectively each day using API. Out of curiosity and to ensure we aren't running into an XY problem, what's the business case behind this?

 

jnkrochman
Level 2

Re: How to get my smart campaign to ignore triggers outside of business hours

The use case is to post to a webhook connected to a google chat space when a specific criteria of lead is created in salesforce, but only during business hours.

What I ended up getting to work was inspired by the suggestion by @SanfordWhiteman. I created a formula field in salesforce that calculates the business hours in a true false statement, when inside business hours, the checkbox is marked true, when outside of business ours, the checkbox is not marked. Then I have the trigger campaign mentioned in the post within marketo run with a filter that checks for the true false statement, if true, it fires, if false, it does not. Kind of hacky, but it works!

SanfordWhiteman
Level 10 - Community Moderator

Re: How to get my smart campaign to ignore triggers outside of business hours

Unfortunately — other than a very hacky way to do this with a series of DateTime and String fields that’s unimaginably complex — this isn’t supported within the platform. You can use a webhook-compatible service to do it, though.

 

That service can work one of two ways:

(1) call it 2x per day (9am and 5pm) to activate/deactivate the campaign

(2) call it every time a your trigger action occurs and have it check the time in real time

 

(1) is obviously more efficient once built, but takes significantly more dev to make it call back into the Marketo API. (2) is very simple, just checking the {{system.datetime}} against a range.

jnkrochman
Level 2

Re: How to get my smart campaign to ignore triggers outside of business hours

Thank you for your suggestions. I use your suggestion as inspiration for my ultimate solution, you can see my copy and paste response to another individual below. Thank you for your inspiration!

"The use case is to post to a webhook connected to a google chat space when a specific criteria of lead is created in salesforce, but only during business hours.

What I ended up getting to work was inspired by the suggestion by @SanfordWhiteman. I created a formula field in salesforce that calculates the business hours in a true false statement on the lead level, when inside business hours, the checkbox is marked true, when outside of business ours, the checkbox is not marked. Then I have the trigger campaign in marketo run with a filter that checks for the true false statement, if true, it fires, if false, it does not. "

Here is the formula used in the true false field within salesforce in case anyone in the future needs this. Note: salesforce runs in GMT, so adjust the timevalues accordingly. Also, if your local timezone does daylight savings, this will need to be adjusted with the time change. I am in AZ where we do not, so for my use case this should fine year round.

IF(
AND(
WEEKDAY(Today()) > 1,
WEEKDAY(Today()) < 7,
OR(
TIMENOW() > TIMEVALUE("16:00:00.000"),
TIMENOW() < TIMEVALUE("00:00:00.000"))), true, false
)

Amanda_Reilly3
Level 3

Re: How to get my smart campaign to ignore triggers outside of business hours

Is there a need for the action to take place exactly at the time of the trigger, or for it to be a trigger at all? I'm wondering if you just have batches running regularly for whatever this use case is. You can schedule a morning and afternoon batch at specified times to cover the hours of operations, and anyone who qualifies can just run through during those times. Anyone who qualified outside of the hours of operations would not run through if you set up parameters for your times.

 

This obviously wouldn't work if you're needing to use trigger tokens, I'm just struggling to come up with any other way to specifically exclude those from after hours.

Amanda Reilly
Marketing Operations Consultant at Etumos
jnkrochman
Level 2

Re: How to get my smart campaign to ignore triggers outside of business hours

Yes, the use case required the trigger to fire within minute. I have created a filter for the trigger using information within salesforce for the Marketo campaign to look for before firing. This ended up being the simplest solution for my use case. Thank you for your suggestion!

SyedBP
Level 1

Re: How to get my smart campaign to ignore triggers outside of business hours

Create a webhook response Yes/No based on your desired time-frame that can be used to 'Remove From Flow", first step in the Flow. 

jnkrochman
Level 2

Re: How to get my smart campaign to ignore triggers outside of business hours

Thank you for your suggestion, I have found a solution inspired by another user.

Amod_Kumar_Shar
Level 2

Re: How to get my smart campaign to ignore triggers outside of business hours

⚠️ This post appears to be an AI-generated hallucination describing features that do not exist. It has been edited accordingly. Please submit only answers that apply to Marketo Engage.

To make your smart campaign in Marketo ignore triggers outside of business hours, you can use a combination of smart list filters and schedule settings. Here's a general approach to achieve this:

 

1. Use a "Member of Smart List" filter to check the time when the trigger occurs. For example, you might use the "Date of Activity" filter to specify the time of the trigger.

2. Add additional filters to check if the trigger falls within your business hours. You can do this by using "Date of Activity" filters to specify the time range corresponding to your business hours. For example, you might use the "Hour of Day" filter to check if the trigger falls within your specified business hours.

3. If the trigger falls outside of business hours, you can use a "Remove from Flow" action or a "Change Data Value" action to skip the processing for that trigger.

4. Additionally, you can set the schedule for the smart campaign to only run during your business hours. You can do this by specifying the start and end times for the schedule in the smart campaign settings.

 

By combining these smart list filters and schedule settings, you can ensure that your smart campaign only processes triggers that fall within your specified business hours and ignores triggers that occur outside of those hours.

/Many Thanks