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

Learn More

View all

Sign in to view all badges

Prevent rule from being triggered if parameter exists

Avatar

Avatar
Validate 1
Level 2
floriane3493069
Level 2

Likes

17 likes

Total Posts

28 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 2
floriane3493069
Level 2

Likes

17 likes

Total Posts

28 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
floriane3493069
Level 2

10-07-2018

Hi there,

I just set up a page load rule. The only condition for this rule is that it is not triggered if a certain parameter exists. Unfortunately AEM only offers me the possibility to trigger the rule if a parameter is pressent. Can you tell me if it is also possible to prevent a rule from being triggered if a parameter exists?

Thank you

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Coach
MVP
StewSchilling
MVP

Likes

342 likes

Total Posts

278 posts

Correct Reply

85 solutions
Top badges earned
Coach
Give Back 25
Springboard
Bedrock
Validate 1
View profile

Avatar
Coach
MVP
StewSchilling
MVP

Likes

342 likes

Total Posts

278 posts

Correct Reply

85 solutions
Top badges earned
Coach
Give Back 25
Springboard
Bedrock
Validate 1
View profile
StewSchilling
MVP

10-07-2018

If you can test for the parameter using javascript then you can accomplish this using a custom condition on the rule.

If a custom condition does not return true, then the condition is not met and the rule will not fire.

As an example, you could use this javascript in a DTM custom condition:

var paramExists = true; //replace this with code to determine existence of the param

if (paramExists) {

  return false;

} else {

  return true;

}

Answers (5)

Answers (5)

Avatar

Avatar
Coach
MVP
StewSchilling
MVP

Likes

342 likes

Total Posts

278 posts

Correct Reply

85 solutions
Top badges earned
Coach
Give Back 25
Springboard
Bedrock
Validate 1
View profile

Avatar
Coach
MVP
StewSchilling
MVP

Likes

342 likes

Total Posts

278 posts

Correct Reply

85 solutions
Top badges earned
Coach
Give Back 25
Springboard
Bedrock
Validate 1
View profile
StewSchilling
MVP

11-07-2018

Jantzen,

  I think we're saying the same thing.

Florian,

  Let us know if you are all set.  I guess, If I got it wrong, swap the return statements in the custom condition.

-Stew

Avatar

Avatar
Validate 1
Level 2
floriane3493069
Level 2

Likes

17 likes

Total Posts

28 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 2
floriane3493069
Level 2

Likes

17 likes

Total Posts

28 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
floriane3493069
Level 2

23-07-2018

Hi Stewart, hi Jantzen,

thank you for your feedback and your discussion. Sorry for my late response, it took me a while to put everything in place. Actually the solution Stewart suggested worked perfectly well. I used the above mentioned code to prevent the rule from being fired if a certain parameter existed.

Thanks again guys. This helped a lot.

Avatar

Avatar
Validate 1000
Community Manager
jantzen_belliston-Adobe
Community Manager

Likes

339 likes

Total Posts

2,331 posts

Correct Reply

819 solutions
Top badges earned
Validate 1000
Springboard
Validate 500
Validate 250
Validate 100
View profile

Avatar
Validate 1000
Community Manager
jantzen_belliston-Adobe
Community Manager

Likes

339 likes

Total Posts

2,331 posts

Correct Reply

819 solutions
Top badges earned
Validate 1000
Springboard
Validate 500
Validate 250
Validate 100
View profile
jantzen_belliston-Adobe
Community Manager

11-07-2018

Stewart,

Wouldn't it be opposite? Florian is wanting to not trigger the rule if parameter2 exists. I believe your code reads

If parameter2 does not equal null (IE if parameters contains a value), return false and thus do not fire the rule

Wouldn't you want to remove the ! from your code so that it read

if parameter 2 equals null, return false and thus do not fire the rule

Thanks,
Jantzen

Avatar

Avatar
Coach
MVP
StewSchilling
MVP

Likes

342 likes

Total Posts

278 posts

Correct Reply

85 solutions
Top badges earned
Coach
Give Back 25
Springboard
Bedrock
Validate 1
View profile

Avatar
Coach
MVP
StewSchilling
MVP

Likes

342 likes

Total Posts

278 posts

Correct Reply

85 solutions
Top badges earned
Coach
Give Back 25
Springboard
Bedrock
Validate 1
View profile
StewSchilling
MVP

10-07-2018

I think I'd do it this way -

Create a DTM data element for parameter2 call it qsParam2.

Then the code becomes :

if (_satellite.getVar('qsParam2') != "") {

return false;

} else {

return true;

}

Avatar

Avatar
Validate 1
Level 2
floriane3493069
Level 2

Likes

17 likes

Total Posts

28 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 2
floriane3493069
Level 2

Likes

17 likes

Total Posts

28 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
floriane3493069
Level 2

10-07-2018

Great, thanks stewarts16448458

Unfortunately I am afraid I am not exactly sure what i have to insert for "//replace this with code to determine existence of the param". Could you give me an example. Let's say my url is xyz.com?parameter1=a&parameter2=b and I want do not want the rule to be triggered if parameter2 exists.

Thank you very much.

Florian