Json Mapper To List
The Json Mapper To List action is one of the actions at your disposal to work with Json data. Json Mapper To List enables you to extract a list of values from a JSON or a JSON array.
The action will be able to query/extract data from a JSON input using a JSONPath expression and save it to a variable.
The action is used to filter the Json data that we will import in our process for future use.
Input Field 1: “Input JSON” - Input your JSON object / Array or a data model.
Input Field 2: “Query” - The Input Jquery expression for obtaining the desired key value of your Json input.
Output Field: "Output" - Returns a list of values corresponding to the JQuery expression.
How to
The variables need to be adjusted according to your expected result for each process.
Example 1
1. Create a new process and give it a name.
2. Drag the JSon Mapper To List action to the canvas and link it to the other actions.


- <%JSONin%> will contain the JSon data, the default will use. The variable will be of Type Json, Single Value.
- <%Filter%> will contain the JQuery expression that we will use in order to extract from the Json input data. The variable will be of Type String and Single Value. The query will retrieve the last book in order (notice that the result of the query will be a list with one value). This is the filter for obtaining the last book: $..book[-1:] <%result%> will be our actions output. The variable will be a List of type Json.
4. Click the Json Mapper To List action to access its configurations and add the variables created at the previous space.

5. Save, Validate and Run the process.
6. The process will ask for the inputs, we could leave the defaults as is for now.

7. Click Run.
8. Click Check Instance to view the results.

Further queries
We will continue with further examples of queries by only changing the <%Filter%> and showcasing the returned results for the same Json input, below the examples.
- <%Filter%> will use $..book[0,1] to obtain the first two books:

- <%Filter%> will use $..book[?(@.isbn)] to filter all books with isbn number:

- <%Filter%> will use $..book[?(@.price<10)] to filter all books cheaper than 10:

1. Create a new process and give it a name.
2. Drag the JSon Mapper To List action to the canvas and link it to the other actions.


- <%input%> will contain the Json data, the default will use. The variable will be of Type JSon, Single Value.
- <%filter%> will contain the JQuerry expression that we will use on our data. The variable will be of Type String and Single Value. In this case ..name
- <%result%> will be our actions output.
4. Click the Json Mapper To List action to access its configurations and add the variables created at the previous space.

5. Save, Validate and Run the process.
6. The process will ask for the inputs, we could leave the defaults as is for now.

7. Click Run.
8. Click Check Instance to view the results. We will see that all first names from the json were saved in the variable.

