Want to add a Configurable link on reactive web app
Question

Hi everyone,

I want to add a link, which opens a URL in the new tab, want the URL to be configurable, so added it as site property but site properties are not accessible on page link component. PFA images for further information

mvp_badge
MVP
Solution

Hi Malvika,

For the mentioned use case, follow the below steps..

Steps:

  • Introduce an Data action (e.g., GetSitePropertyValue) in the screen scope
  • Within the Data action, define an Assign node which sets the action output parameter value with the Site property value
  • To open the URL, set the ExternalSite node as the OnClick handler
  • As the URL input parameter value to the ExternalSite node mapped with the OnClick of the Link widget, reference the Data action output parameter value
  • To open the page in a new tab, add target attribute with '_blank' value to the Link widget (in Attribute section)

Note: The defined site property values can only be accessed in the server-scope, it is not availablie in the client side.


I hope this helps you!


Kind regards,

Benjith Sam

thanks @Benjith Sam , this solution worked.

mvp_badge
MVP

You're welcome, Malvika

Glad to help you :)


Kind regards,

Benjith Sam

Hi @Malvika Singh , you can’t directly use site properties on client side 

You may have two options 

One is to use client variable

If you only want to use site property, add a server action and then access the site property and use the same server action on client action which is bind to your link/button


Thanks,

Sandeep.

Hi @Malvika Singh, my suggestion is to create a simple page (backoffice) where you can configure this URL or other you might need in the future. To do that, you can create a new table, and in the ID put it to text, so you can have a unique text id. To get the URL, you can create a get action to get the URL of that identifier.
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.