Use Project Variables in Applications (HTML tile)

VFL
VFL Registered Posts: 11 ✭✭✭
edited July 2024 in Using Dataiku

Hello,

I am building an application, and part of the process is for the user to visit a particular notebook (to look at plots and choose parameters).

I am trying to build a simple "url link" message in the Application UI, but I can't find how to use variables in it.

  • I chose the "Variable Display" tile
  • Then in HTML, I was looking for something like this :

<a href = "server/" + ${projectKey} + "/notebooks/jupyter/my_notebook">Open the notebook</a>

But it does not work.

Any idea of I could manage to display such link ?

Best Answer

Answers

  • VFL
    VFL Registered Posts: 11 ✭✭✭

    Yes ! I tried it earlier and it did not work, I must have done something wrong.

    Thanks a lot

  • Torben
    Torben Registered Posts: 3 ✭✭✭

    I have a local project variable called "app_link", i.e. "app_link": "some_local_url"

    In the Application Designer page, I would like to create a link as above: <a href='${app_link}'>Open link</a>

    However, once testing the application UI, I get the following error

    image.png

    Only simple text can be rendered - as soon as I use any anchors the code fails?

  • Alexandru
    Alexandru Dataiker, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 1,323 Dataiker

    Hi @Torben,

    Can you confirm that value of your some_local_variable is relative URL to the webapp e.g

    {
    "app_link": "projects/MODEL_TRAINING_TESTS/webapps/gZ0One6_test/view"
    }
    This seems to work fine on DSS version 13.x and 14.x , can you confirm your current DSS version? If this is stil not working you may want to open a support ticket to track this further

    Thanks

  • Torben
    Torben Registered Posts: 3 ✭✭✭
    edited August 11

    Hi @Alexandru

    Thanks for the quick reply. Just for reference, we are running version 13.4.2.

    My problem is not just the structure of the relative URL, it is simply the fact that if I insert any HTML tag it fails, e.g.:<b>test</b>. This is quite unfortunate because I will use the variable trick to avoid embedding a web app as an insight in a DSS Dashboard, which is limiting the functionality of my Shiny app.

Setup Info
    Tags
      Help me…