The Json Mapper action is one of the actions at your disposal to work with Json data. JSON Mapper enables you to extract a value 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.
You can use this website to test your JPath queries.
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 Field1: “Result” ( JSON Object value corresponding to the query)
1. Create a new process and give it a name.
2. Drag the Json mapper action to the canvas and link it to the other actions.
- <%input%> will contain the JSon data, the default will use
- <%filter%> will contain the JQuerry expression that we will use on our data. In this exaplte the <%filter%> will be ..name
- <%result%> will be our actions output.
4. Click the Json mapper 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, w could leave the defaults as is for now.
7. Click Run.
8. Click Check Instance to view the results. We will se that the first name from the json was saved in the variable. Keep in mind that the action will extract only one value from a JSON or a JSON array.