JSON Generator (Mock)

Learn how to create JSON objects using the JSON Generator component for the Digibee iPaaS. The Documentation Portal provides configuration parameters of the component.

JSON Generator (Mock) creates a JSON object. This component accepts any input.

Parameters

Take a look at the configuration options for the component. Parameters supported by Double Braces expressions are marked with (DB).

Usage example

In this example, we used the JSON Generator (Mock) component to modify someone’s data. Here, we want to join the firstName and lastName properties into a single property called fullName. We also want to delete the phoneNumber property and add a property called country, which has the value “Brazil”.

Input

{
    “firstName” : “Carlos”,
    “lastName” : “Silva”,
    “phoneNumber” : “+55(11)99999-8888
}

Parameter settings

We use the JSON Generator (Mock) component with the following JSON parameter configuration:

{
    "fullName" : {{ CONCAT(message.firstName," ", message.lastName) }},
    "country" : "Brazil"
}

Here, we used the CONCAT Double Braces function to join the first and last names, with a blank space between them.

Output

{
    "fullName": "Carlos Silva",
    "country": "Brazil"
}

Last updated