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.
Discussion posts and replies are publicly visible
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.
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.
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.
vgarcmon said:I found that with the formula "extract(linktodocument(0, "doc"), """", "doc/")" it is obtained dynamically
That's the way I've seen before. FWIW, this method still works but there's no guarantee it won't be removed / changed in the future without [much|any] notice; and also, I believe this was the method used before Environment Specific Constants were introduced (so, a while ago, now).