Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

DTM: Custom Condition

LAE
Level 2
Level 2

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?  

1 Accepted Solution
mikethompson
Correct answer by
Level 5
Level 5

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

View solution in original post

0 Replies
mikethompson
Correct answer by
Level 5
Level 5

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

View solution in original post

LAE
Level 2
Level 2

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!!