Skip to main content
Level 2
Oct 16, 2015 2:27 AM UTC
Solved

DTM: Custom Condition

I can't find any documentation about custom conditions ANYWHERE (typical!), other than the question mark in the setup ("Enter a script that must evaluate true/false to control whether this rule executes.").  What exactly does the format of this have to be?  I have the following entered:

document.getElementsByClassName('errorMessageContainer').length!=0

This evaluates to TRUE, but the rule is not firing. Does this need to include something else? I've tried various other ways and can't get anything to work.  Anyone have any ideas?  

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
mikethompson1Accepted solution
Level 4
Oct 16, 2015 2:27 AM UTC

You have to use 'return' like you would in a javascript function. 

2 replies

Level 2
Oct 16, 2015 2:27 AM UTC

Well, I thought I had already tried this option and it hadn't worked...but now it is!

You need to put the full "if" in there and return true, not just a simple statement that evaluates as true.

Thanks!!

Translate
mikethompson1Accepted solution
Level 4
Oct 16, 2015 2:27 AM UTC

You have to use 'return' like you would in a javascript function. 

Translate