Unable to Open an External URL or Site

Hi All,

I am aware that there are other somewhat similar posts but it seems that the solution there won't work for me. Still, I am unable to Open an External URL or Site within my Web App.

there exist a slash character "/" in between external and the URL. Even though there is really none.


I tried below recommendations but no luck on making it work.

https://www.outsystems.com/forums/discussion/26259/open-url-in-new-window-in-ios-app/


Hoping you can help with below concern.


Regards,

Mond Reyes

Hi 

The solution you are referring to is for mobile app. 

For the web, just give the url as is, without prefixing it with "external:"


Regards


Hi, usually you just need to type the fully qualified URL, like this "https://www.google.com". Preferably all in lower case.

If you are taking the URL value from database i.e. URL is entered by users. 

Then you need to check if URL contains "https://" or not. You can do that using Index() function.

If index function returns, positive value, just pass the DB value as it is. 

If URL returns -1, then append "https://" to your URL. i.e. "https://" + DB value

You URL value should look like this :

 If(Index(URL,"https://") <> -1,URL, "https://" + URL)


Thanks and Regards,

Suraj Borade

Also for web app, you need to add target as "_blank"

Suraj Borade wrote:

Also for web app, you need to add target as "_blank"


Hi Suraj,


It's a good point, but it's just if he wants to open the link in a new tab.


@Raymond, if you want to follow Suraj suggestion (that it is a good one) you just need fill Extended properties like this:


Best regards,

Ricardo

When I tried the Extended properties "target" = "_blank", it is being opened in a new tab together with our hostname. Notice that there are 2 http or https in my screenshot below.

Thanks Suraj Borade, but what if I wanted to rely on the value coming from the database. Like in my sample below. It is opening as a new tab, but our OutSystems hostname is being concatenated in the front of the URL.

Solution

Hello Raymond, 

I believe the value you are getting from the database is not a proper url. (must have some other prefix characters)

If the value of the url does not start with http:// or https://  the platform will prefix the hostname and application name to your value. 

Please check the database value. 

Hope this helps !!!


Solution

Hi,

Try to debug that action and verify the string that is passed to URL. See if that string is correct or if you will need to treat that. If so, treat it and pass that value to the link URL property.


Best regards,

Ricardo

Thank you, I checked the value from database / REST API and it is incorrect format!

Thanks all for the help!