Specifying the format for a value

You can enforce the JSON data type used in the request output for each value. To do this, add the specifier at the end of the data key in the JSON code.

Example

If you add the following JSON code:

{
    "request": {
       "body": {
          "contact-priority!s": "{contact.priority}", // convert number to string
          "contact-language!sl": "{contact.language}", // convert string to lowercase
          "contact-queue!js": "{contact.queue}" // convert object to JSON string
       }
    }
}

If you have the following contact object data at runtime:

  • Priority: 50
  • Language: "EN"
  • Queue:
    {"id": "C9177D585DA5EE11B3ED58961D1810CC", "address": "chat.queue@acme.com"}

The data will be resolved in the output as:

{
   "contact-priority": "50",
   "contact-language": "en",
   "contact-queue": "{\"id\":\"C9177D585DA5EE11B3ED58961D1810CC\",\"address\":\"chat.queue@acme.com\"}"
}
Table 1. Value format specifiers
Specifier Description If conversion fails
!i Converts resolved value to integer Use value as-is
!js Converts resolved value to JSON string Use value as-is
!s Converts resolved value to string -
!sl Converts resolved value to string in lowercase -
!su Converts resolved value to string in UPPERCASE -