1. Tasks
  2. Org Global Value

Tasks

Org Global Value

Performs an operation on or creates a pair of key-value data that is accessible to all stubs.

Uses

  • Use to store a value across all your templates
  • Use to store temporary data that you need across stubs

Basic usage

loading...

Parameters

key
required
string

The key on which the operation will be executed. It needs to consist of a minimum of five parts seperated with :.


operation
string

The operation that will be executed on the key.

Options:

  • set:

    Sets the key to the value of the savevalue parameter.

  • get:

    Returns the value of the key.

  • delete:

    Deletes the key.

  • increment:

    Increments the value of the key.

  • decrement:

    Decrements the value of the key.


savevalue

The value the key is set to, if the operation is set.


expiry_date

If set, this determines the date at which the key's value will expire.


expire_in
number

If set, this determines the amount of time, in seconds, after which the key's value will expire.

Result

editor
        
    "success": true,
    "payload": {
        "key": "key_one:key_two:key_three:key_four:key_five",
        "value": "Hello!",
    },

      

Properties

key
string

The key on which the operation was executed.


value

The value of the key after the operation has been executed.


Examples

Set value with expiry date

Set a global org value with an expiry date.

editor
            {
        "tasktype": "orgglobalvalue",
        "params": {
            "key": "company:marketing:copy:slogan:2024",
            "operation": "set",
            "savevalue": "Liberate humans from mundane work",
            "expiry_date": "2025-12-31"
        },
    }

      

Get value and save to stub data

Get a global org value. You will need to use a savedata task to save the value into the stub.data.

editor
        {
  "get_org_value": {
      "tasktype": "orgglobalvalue",
      "params": {
          "key": "company:marketing:copy:slogan:2024",
          "operation": "get"
      },
  }
}

      

Save the value from the previous task

loading...