Forum Academy Marketplace Showcase Pricing Features

Possible to add a workflow condition based on the URL entered?

I’m trying to do something that I thought would be pretty simple but I just can’t seem to find a solution.

I have an input where the user enters a URL in a text input and then submits it. If that URL contains certain domains, I want to execute certain items in the workflow, otherwise skip.

For example, if they entered “https://bestbuy.com/product/blah-blah-123/” I would want the workflow to execute a particular action, but if it was "https://amazon.com/product/you-get-the-point/ then I would want it to skip.

In the above example I have any URL’s from bestbuy.com or samsung.com as my whitelist but I’ve tried so many commands and just can’t seem to crack this type of conditional value. What am I doing wrong?

I feel like that ‘Only when’ dynamic expression isn’t completely valid. Try “Input Insert Product URL’s value contains bestbuy.com or Input Insert Product URL’s value contains samsung.com”.

Thanks for the reply! I tried your format and still no luck. From my reading it seems like “contains” is less of a “partial match” filter and more of an exact match for an item in a list. So I think something entirely different would need to be done here.

Alright so I figured it out! This is actually pretty easy. You’ll just need to use regex to find matches. As for the expression, if I am just checking for one domain I would enter:

(amazon.com)

If I wanted to check for a match among multiple domains, just add the | separator:

(amazon.com|walmart.com|costo.com)

So as you can see in this screenshot, the workflow item will only execute if (looking at the input box) the user included a domain NOT on that list. Hence why :count is 0 (no match). If I wanted to require a match, I’d simply use :count is 1.

Hope this helps someone!