Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.

This page shows an example of Variable Insertion in Usage Engine using stream consisting of the HTTP Client function.


  1. Enter the JS code using the Script function. Example of a JS code snippet:

    No Format
    await push({
        url: '',
        foo: 42,
        bar: 'kawaboom!',
        baz: payload.value % 2,
        someData: {
            alpha: 1337,
            beta: 'foobar'

  2. Configure an HTTP request response in the following format. You can substitute the values of variables defined in the JS code snippet using ${variable} or @{variable}.


    While configuring HTTP body, you must add the JSON objects within quotes (" ") . Applicable only for JSON objects that return value in the string format.


    Code Block
    "comp": "dr",
    "dept": "pm",
    "score": 100,
    "name": "@{}",
    "age": "@{payload.age}"

    You will receive the following httpResponse:


    However, if you do not use " " with ${name} or ${age} or both, then you will see the httpResponse in the string format as shown below:


    { "age": 18, "comp": "dr", "dept": "pm", "score": 100, "name": "jason" }