Skip to main content
vicentg0001
New Participant
Jun 9, 2022 3:34 PM UTC
Solved

Know the base URL of the current environment

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.

    mikes0011
    mikes0011Answer
    Brainy
    Jun 9, 2022 3:38 PM UTC

    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

    4 replies

    mikes0011
    mikes0011Answer
    Brainy
    Jun 9, 2022 3:38 PM UTC

    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
    Jun 9, 2022 9:42 PM UTC

    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
    New Participant
    Jun 10, 2022 9:13 AM UTC

    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.