20
Views
7
Comments
Solved
Make dynamic link to external website
Question

Dear all,

I am new to Outsystems, so still a lot to learn. I am looking for a solution to this problem: 

I want to make a clickable icon which redirects to an external weblink. The variable must be linked to the "getfundbyId.List.Current.Fund".


An example of the external link is this:

https://api.fundinfo.com/3.0/document?apiKey=f47b210a-1e9a-49a6-b9bf-69e7dfa31c80&shareclass=IE00B3D07S45&documenttype=PR&country=CH&language=EN

In this link you see a number starting with IE. This should be replaced by the "getfundbyId.List.Current.Fund", and of course open in a new tab.


Is this possible?

Thank you!

Erwin

Solution

Hello Ervin,


Plz find below snaps for complete process :

Step1. Right click on the icon and select Link to-> RedirectToUrl

Step2:

Link property : 

Step3:

Double click on URL property and write like this :

Step4: 

Change to open link in new tab:

Done. Cheers!


Sanjay

Hello Ervin,


Yes, it is possible and very simple to implement. You just need to write your static URL in string format and add dynamic data in expression. Like this :

"https://api.fundinfo.com/3.0/document?apiKey=f47b210a-1e9a-49a6-b9bf-69e7dfa31c80&shareclass=IE"    + getfundbyId.List.Current.Fund  +  "&documenttype=PR&country=CH&language=EN"


Let me know if it helps!


Sanjay

Rank: #2148

Hello Erwin ,

If i understand correctly you need to replace the number starting with IE with your variable. 

You can do this by creating the URL on the link itself.

Something like : 

"https://api.fundinfo.com/3.0/document?"+yourApiKey+"&shareclass="+getfundbyId.List.Current.Fund +"&documenttype=PR&country=CH&language=EN "

I'm assuming that there are some "static" parts to the link.

This solution can create some overhead on your loading, depending on the length of your list, so keep that in mind.

To make the link open in a new tab you must simply add the "target _blank" extended property on the link. 

Please refer to this post : https://www.outsystems.com/forums/discussion/33138/open-page-in-new-tab-window-when-you-click-the-link/


Hope it helps :) 

Happy coding ! 

Paulo Rosário 

mvp_badge
MVP
Rank: #78

Hi Ervin,

In addition to Sanjay's comment, attaching a sample application .oml file

See this sample app (Click the Dynamic URL column link - It will redirect you to the Google Search page with pre-filled search value)


Hope this helps you!


Kind regards,

Benjith Sam

ReactiveDynamicURL.oml

Solution

Hello Ervin,


Plz find below snaps for complete process :

Step1. Right click on the icon and select Link to-> RedirectToUrl

Step2:

Link property : 

Step3:

Double click on URL property and write like this :

Step4: 

Change to open link in new tab:

Done. Cheers!


Sanjay

Rank: #32021

Hi all,


you guys are HERO's! :) Thak you for your quick solution, it works! Now I am afraid I will spam you more often with questions :)


Thanks!

Erwin