Exact match in branching using "contains" option | XM Community
Question

Exact match in branching using "contains" option

  • 18 December 2020
  • 2 replies
  • 15 views

Userlevel 7
Badge +23
  • Level 5 ●●●●●
  • 449 replies

Hi all,
I am setting up embedded data based on URL, and want to use certain URL parameters. The problem I am facing is the following.
What I want:

Branch if URL contains /product1/

ED`=Product1

Branch if URL contains product1-updates

ED=Product 1 Updates


Is it possible to make a filter with exact match including / sign?


2 replies

Userlevel 7
Badge +21

One option could be to use nested conditions. So the flow would be:

  1. If URL contains "Product 1"; Assign ED=A

  2. If URL contains "Updates"; Change ED from A to B.

The other option could be to use "matches regex". In regex
$
stands for the end of the line.
  • Product 1$
    : Would match "Product 1", but not "Product 1 Updates"

  • Product 1\\d|\\D+$
    : Would match "Product 1 Updates" but not "Product 1"

More on Regex here

Userlevel 7
Badge +23

Thank you ahmedA Will have a look at it.

Leave a Reply