Way to add environment variable so that we can use everywhere like Rest Message Endpoint?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-23-2017 07:49 PM
hi developers,
I have added some Rest Messages in my SN instance. Sometimes I need to change the endpoint for the same rest message so I am wondering if there is a function in Service Now that I can store all my environment variables and used everywhere? I tried to search this and only get the information about add variable substitutions which can be only used inside the HTTP Method.
The Endpoint like: http://&{IPAddress}:9000/oauth2/token. We need to find a place to store this IPAddress which can influence all the rest messages.
Thanks,
Leemey

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-23-2017 08:06 PM
A system property sounds like what you're looking for.
Table: sys_properties
Set: gs.setProperty('property.name');
Get gs.getProperty('property.name');
Either this or a custom configuration/definition table if multiple simultaneous configs are needed (e.g. one for DEV, one for TEST, one for PROD).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-23-2017 09:10 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-23-2017 09:12 PM