Redirecting URL based on condition

Hi All,

I am developing a mobile application and I have an requirement wherein I have a client action and I am having two variables in that. With that variables, I need to redirect to various things based on a condition

For example :

  • If I find "WEB" as a value in that first variable, I need to launch an URL found in "data" (second variable) element over current page
  • If I find "WEB_NEW_TAB"  as a value in that first variable, I need to launch URL found in "data" element in new tab
  • If I find "VOICE" as a value in that first variable, I need to launch dialer with number found in "data" element
  • If I find "CLOSE_TAB"as a value in that first variable, I need to close current browser window

Thanks,

Hema

Hi Hema,

You can switch widget in client action 

For Condition 1(web):  put Redirect to url  at the end and pass url found in data variable.

For Condition2(web_new_tab):  insert javascript with one input parameter for url "window.open(UrlInputParameter,"_blank")" and pass url found in data as input to javascript.

For Condition 3(voice):insert redirectToUrl and pass url as "tel:"+dataVariable(phoneNo).

For Condition 4(close_tab):insert javascript "window.close()".


Regards,

Pramod.

Hi Pramod,

Thank you.

I am getting the below if i try to close the current browser window by giving "window.close()".

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.