URL Parameter Contains?

I may be going about this incorrectly but I have a URL parameter that technically contains two values and it can be a combination of those values but a single yes is required for the element to show.

For example:
?key=Yes,No (show)
?key=No,Yes (show)
?key=No,No (don’t show)
?key=Yes,Yes (show)

Is this possible? Without creating multiple OR statements within the conditional logic?

Thinking something like IF KEY | CONTAINS |YES

Appreciate the help.

Hi @DoncoMarketing,

If you add an Element Condition set to “Expression > String” and click the middle is a few times it will cycle over to in and not in which is basically a “contains” operator. That means you could do something like

If Yes | in | {{dc:url:param key="key"}}

I think that would satisfy all the conditions you have in your example.

Thanks @alexander,

This is great but is it possible to do the logic in that order? I thought you can only have:
{{dc:url:param key="key"}} | in | Yes – which does not work.

Scratch that. I had absolutely no idea the logic could accept the reverse order for a string :man_facepalming:

Annnnnnnnnd it works. Seriously, thank you.

You’re welcome! Glad you got it working. We figured we may as well make both sides accept Dynamic Content. Doing it backwards does feel a bit unnatural at times but sometimes its the only way to make the logic work.

1 Like