Overview

environment-variables.mp4

Environment variables let you keep one copy of your metadata and deploy different values to each org. Use them for values that change between environments, such as endpoint URLs, Remote Site Settings, email addresses, usernames and custom metadata values.

Without environment variables, a deployment carries the source org's values with it. For example, deploying a Remote Site Setting from UAT to Production would leave Production calling the UAT endpoint. With an environment variable, Prodly puts in the right value for each destination:

<aside> <img src="/icons/warning_red.svg" alt="/icons/warning_red.svg" width="40px" />

Don't store passwords, tokens or API keys in environment variables. Values are plain text, visible to everyone with access to environment variables, and may be committed to Git.

</aside>

The Environment Variables Page

To access the page, go to the Release app and click Settings → Environment Variables.

The All Environment Variables table shows one row per variable and one column per org and Git branch, so you can see every value in one place. It also shows each variable's:

An org without its own value shows Uses default, or No value if the variable has no default.

Create an Environment Variable

To create an environment variable:

  1. From the Environment Variables page, click New variable.
  2. On the Settings tab:
    1. Enter a Name. Prodly shows the variable's placeholder underneath, for example {!Environment.PaymentsApiUrl}.
    2. Optionally, enter a Description. It's shown as a tooltip in the table.
    3. For Match, choose Anywhere (replaces the value wherever it appears) or Whole value.
    4. In Files, enter the files the variable applies to, one per line. Use a file or folder path, such as classes/PaymentsService.cls or remoteSiteSettings/, or a pattern, such as **/*.remoteSite-meta.xml. Only matching files are changed. Click Pattern examples for more.
    5. For In Git, choose Value or Placeholder. See Value or Placeholder in Git below.
  3. On the Values tab:
    1. Optionally, enter a Default.
    2. Under Orgs, enter a value for each org.