Comparing 2 strings usign wildcard

Lets say I take the url of a website and call it variable “URL”

URL can be any thing like:
www.goog.com/CRM/123123sdadawa123
www.goog.com/HOME/12312wqeq13rtw4

I want to use a switch condition

case when URL = “www.goog.com/CRM/" then do action 1
case when URL = "www.goog.com/HOME/
” then do action 2

how should i type the condition expression , in my case case when URL = “www.goog.com/CRM/*” . Considering I have a wild card * which i am not bothered with what comes after that.

is this possible?

@wzlim1024 You can use any of the string functions like URL.Startswith(" www.goog.com/CRM/“) or URL.Contains(” www.goog.com/CRM/" instead of using wildcard character.

In this case, you will have to go with If Else.

4 Likes

Thanks Sugumar8785!

Can we use switch activities? Its neater if I got 2 conditions or more?

Or if I have more than 2 conditions what should I use ?

case when URL = “http://www.goog.com/CRM/ * " then do action 1
case when URL = “http://www.goog.com/HOME/ * " then do action 2
case when URL = “http://www.goog.com/HR/ * " then do action 3

@wzlim1024 In that case,

Using IF activity check the URLS , Based on what URL it holds , create 3 variable and assign some unique values for each.

Use them in Switch case.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.