Skip to Content (Press Enter)
OutSystems.com
Personal Edition
Community
Support
Training
Training
Online Training
Developer Schools
Boot Camps
Certifications
Tech Talks
Documentation
Documentation
Overview
ODC
O11
Forums
Forge
Get Involved
Get Involved
Jobs
Ideas
Members
Mentorship
User Groups
Platform
Platform
ODC
O11
Search in OutSystems
Log in
Get Started
Back to Forums
Steve Dalgleish
175
Views
8
Comments
Variables between environments
Question
Looking for a bit of advice. In our espace, we store a link to an internal API we use to exchange data with another application. Now, while we're developing, we're pointing to a test copy of the API but when we move to a live environment, we will want to point to the live copy of the API. Is there a good/easy way to manage values (either through a static entity, or a sort of global variable) between environments?
J.
MVP
Erm,
My suggestion would be a site property
see:
https://www.outsystems.com/help/servicestudio/8.0/default.htm#Language_Reference/About_Site_Properties.htm
Slightly offtopic, but why did you not thought/used site-properties before?
André Vieira
Staff
Hi Steve,
Statler suggestion is right on the money. I'm just curious on how you are accessing this API. If it is a webservice you don't really need the site property. You already have the possibility to configure the URL in the different environments. Is this your case?
Cheers
Steve Dalgleish
Thanks for the responses. I hadn't considered site properties as I wasn't sure how I could vary them between environments if I'm using Lifetime to push changes. I see that I can edit them in Service Center, however, if I set a site property in our Dev environment, push using Lifetime to QA, will the site property from Dev overwrite any existing site property in QA?
André - yes, it's a web service, so the URL would vary depending on the environment, for instance from https://devurl/api to https://qaurl/api to https://liveurl/api so even a way to manipulate the url depending on the server name would work.
Curt Raddatz
There is a component in Forge called Environment Sticker (
https://www.outsystems.com/forge/component/489/environment-sticker/
) that is able to identify the environment that is being run and allow you to do things based on that information. The component just displays something on the screen when you are in a development environment. Instead of that you could take the same logic and alter URL's, or whatever else you need to do different in the different environments. Check it out!
Steve Dalgleish
Thanks Curt, that's really useful. I've fired that in and it appears to be working perfectly.
António Melo
Steve,
if you've used the Development Environment to add the WebReference to your eSpace Module, then you have extra options to configure it in Service Center (that's what André was suggesting).
After you publish it, go to Service Center, select the eSpace module, Web Services tab:
Click the Web Reference (in this case "DataMigration"):
As you can see, in this case I didn't define an Effective URL, so the Default URL is being used. Had I defined it, that Effective URL had been used instead. Once you define an Effective URL, the platform will use it, even if you publish new versions of your application.
Steve Dalgleish
Thanks António, it's a REST web service I'm using, so I'm not sure if I can use web references as there is no WSDL?
António Melo
If you are consuming REST, you didn't define it directly in the Development Environment. But in a few months, with OutSystems Platform 9.0, you'll be able to do it - and then also take advantage of the effective URL in Service Center.
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
See the full guidelines
Loading...