Skip to main content
vicentg0001
June 9, 2022
Solved

Know the base URL of the current environment

  • June 9, 2022
  • 4 replies
  • 1 view

Hello!

I wanted to know if anyone knows how to get the base url of the current environment, if there is any expression rule by default.

Greetings, Vicent.

    Best answer by mikes0011

    Last I've checked, the "best practice" way to do this is to store the enviornment URL in a Constant.  There are other unsupported / less-supported workarounds that can do it programatically, but they're pretty kludge-y in comparison with the elegant solution of a constant, unless *absolutely* needed for some reason.

    4 replies

    mikes0011
    mikes0011Answer
    Brainy
    June 9, 2022

    Last I've checked, the "best practice" way to do this is to store the enviornment URL in a Constant.  There are other unsupported / less-supported workarounds that can do it programatically, but they're pretty kludge-y in comparison with the elegant solution of a constant, unless *absolutely* needed for some reason.

    The Expression Guru
    peter.lewis
    Employee
    June 9, 2022

    Agreed with Mike that having a constant is probably the best way. I'm curious though - can you talk more about your use case? There definitely are some reasons why you might need the URL, but there are also a decent number of out-of-the-box links that might meet your use case.

    vicentg0001
    June 10, 2022

    I have opted for the solution you mention Mike, the idea is to have the URL of the environment to report it in a response of a POST method in a webAPI. I found that with the formula "extract(linktodocument(0, "doc"), """", "doc/")" it is obtained dynamically but it is deprecated. Thanks to both of you.