If you find any errors, typos or have general feedback, select the text and click CTRL+ALT+ENTER.

Introduction

Settings service allows you to save app information, such as API keys and URLs, into a settings file, and then reference the data from anywhere in the app. This also allows you to make changes in one place, rather than having to replace the same value everywhere in the app.

New Settings service

To create a new Settings service, from Project view > CREATE NEW > Service, check “Settings(REST Settings)” and click “Create Service.” An empty Settings service looks like:EmptyService

To create a parameter, enter its name and click “Add”:ParametersCreated

It’s basically a properties file with key/value entries. You can also specify an optional description.

Using Settings values

You can use the values from a Settings service in defining a REST service, and also in JavaScript.

Using the values in a REST service

When defining a REST service, set the Settings property to the Setting service’s name:Settings

To refer to a value in the settings file, use {name}. For example: {url}.
url

Using the values in the Request tab:RequestTab

Using the values in JavaScript

The Settings service is a hash that can be set in runtime. For example, if the service is called AppSettings and has airport_code key then you can set it like this via JavaScript:

You can read the values similarly:

Or:

Plugins

Most plugins use a Settings service to keep data (such as API keys), in one centralized place. When creating a new plugin, you can keep this data in a Settings service as well.