Variables
A variable provides a value when a request runs. Use variables for values that change between users, accounts, or environments.
Variables use the same placeholder grammar as operation-result references. Dynomate substitutes placeholders before it sends each DynamoDB operation.
Request variables and the request environment selectors require access to a request tab. Request tabs are available during a trial and with Professional or Enterprise access.
Scopes and Precedence
Dynomate has three variable scopes:
- Global environment variables are available to all request collections when that global environment is selected.
- Collection environment variables are available to requests in the active collection when that collection environment is selected.
- Request variables are saved with one request.
If the same name exists in more than one active scope, Dynomate uses this precedence:
Request > Collection environment > Global environment
Disabled environment variables are not added to the runtime context. Request variables do not have an enabled setting.
Configure Environments
The title bar shows a Global selector and a Collection selector when a request tab is active.
- Open a request tab.
- Select Global or Collection in the title bar.
- Select Configure Environments....
- Enter a new environment name.
- Select the + button.
- Select Add Variable.
- Enter the variable name.
- Enter the variable value.
- Select Save Changes.
- Close the dialog.
- Select the environment in the title bar.
Environment values are strings. You can disable a value without deleting it. You can also use Bulk Edit or import a .env text file into the selected environment.
Configure Request Variables
- Open the request.
- Select Variables in the request header.
- Select Add Variable.
- Enter a unique key.
- Enter the value.
- Select Save in the Variables dialog.
- Select Save in the request header.
The first Save applies the values to the open editor. The second Save writes the request and its variables to the collection file.
Request values can be strings, numbers, booleans, null, arrays, or objects. The editor parses valid JSON values. Other input remains a string.
Use a Variable
Use this placeholder syntax:
${variable_name} A placeholder can fill a complete value:
${account_id} A string can contain more than one placeholder:
arn:aws:dynamodb:${region}:123456789012:table/Orders-${stage}
Type ${ in a variable-aware field to open suggestions. Dynomate can suggest active variables and results that are available before the current operation.
Substitution uses object-field and numeric-array-index paths. It performs one pass. It does not run JavaScript or evaluate expressions.
Supported Fields
You can use variables and earlier Query-result references in these current request fields:
- AWS profile
- Table ARN
- Query key values
- Put Item attributes and condition values
- Update Item keys and field values
- Delete Item keys and condition values
Do not use placeholders in Query limit, consistent read, sort order, index name, operation name, or DynamoDB expression text. These fields are not template fields in the current request editor.
See Reference Query Results for result paths such as ${find_order.items[0].orderId}.
Storage and Secrets
- Request variables are stored in the request TOML file.
- Collection environment values are stored in JSON files under the collection
environments/directory. - Global environment values are stored in the local Dynomate application database.
The Secret setting masks an environment value in the editor. The value remains in local storage. Do not commit a collection environment file that contains a credential or another sensitive value.
Practical Example
This example uses one request with a selected collection environment and one request override.
- Create a collection environment named
staging. - Add
profile_namewith the valuestaging-admin. - Add
table_arnwith the staging table ARN. - Select the
stagingcollection environment. - Add the request variable
account_idwith the valueaccount#42. - Set the operation profile to
${profile_name}. - Set the operation table ARN to
${table_arn}. - Set the Query partition-key value to
${account_id}. - Select Execute.
If a selected environment does not define a required value, the operation fails before its DynamoDB call. Add the missing variable or select an environment that defines it.