Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Suggested Answer
+2
person also asked this
people also asked this
Replies
16 replies
Answers
2 answers
Subscribers
10 subscribers
Views
13148 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
expression to get the environmental URL
garethm
over 7 years ago
Hiya all,
Is there an expression that can be used to the the base URL for the environment - the xx.yy.com/suite part?
TIA,
Gareth
OriginalPostID-259636
Discussion posts and replies are publicly visible
Top Replies
Ram
over 7 years ago
+1
Certified Lead Developer
Hi Gareth, rule!APN_getSiteUrl() might solve your problem. Hope this helps
Puspendu Pal
over 7 years ago
+1
If you dont want to use the deprecated method, you may try to get the base URL(xx.yy.com) using urlforrecord as follows: with( local!anyURL: urlforrecord( recordType: ri!recordType, identifier: ri!recordIdentifier…
Navin Reddy
over 2 years ago
+1
suggested
Certified Lead Developer
regexfirstmatch("https://[a-z]+\.[a-z]+\.[a-z]+",a!urlfortask(0))
0
Ram
Certified Lead Developer
over 7 years ago
Hi Gareth,
rule!APN_getSiteUrl() might solve your problem. Hope this helps
Cancel
Vote Up
+1
Vote Down
Sign in to reply
Verify Answer
Cancel
0
garethm
over 7 years ago
Thanks - perfect!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Josh
Certified Lead Developer
over 7 years ago
note that rule!APN_getSiteUrl() uses fn!linktodocument() which has been deprecated and may be removed in a future release.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Tim
Certified Lead Developer
over 7 years ago
Hi Gareth! You consider having an application that contains constants to store these values and then deploying and modifying per instance for your environments. These can be very useful for things such as dynamic WSDLs.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
garethm
over 7 years ago
Hiya Tim
We had that system (constant, array constant and a choose statement which you set up for us!)... but the environmental constant can be easily overwritten by accident which changes the behaviour of the site - not by me I hasten to add!
So I was looking for a more fool-proof way to identify the environment and use that instead.
rule!APN_getSiteUrl() seems to work nicely...just hoping that the deprecated nature does not come back to haunt me!
Gareth
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Tim
Certified Lead Developer
over 7 years ago
Its always a rick using a deprecated function. The environment constants should be in a standalone app with a description that states they should only be deployed once and that app excluded from the dependency checks on other apps. Relies on people reading instructions of course ;-)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Puspendu Pal
over 7 years ago
If you dont want to use the deprecated method, you may try to get the base URL(xx.yy.com) using urlforrecord as follows:
with(
local!anyURL: urlforrecord(
recordType: ri!recordType,
identifier: ri!recordIdentifier
),
left(local!anyURL,search("/suite",local!anyURL))
)
Cancel
Vote Up
+1
Vote Down
Sign in to reply
Verify Answer
Cancel
0
garethm
over 7 years ago
Thanks - much more comfortable using this than a deprecated function.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sam.zacks1
over 7 years ago
Additionally you can create a constant and point directly to the user record since it will always exist in the application.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Satty
over 7 years ago
in reply to
Ram
Thanks for that, but it is returning url till suite only, if i need entire UrL along with sub pages and parameter like;
www.appian123.ca/.../supplier-contact-registration
then, if anyone has any idea, do suggest
thanks
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
>