< All Topics

Extract data from JSON

JSON is an important data format used to exchange data between two systems. Now, you can ask AI models like ChatGPT, Claude, or Gemini to analyze conversations or images and return the response in JSON. When you have a JSON response, you extract data from JSON and save it in multiple custom fields.

Botamation implemented a new action called “Get data from JSON” that allows you to extract data from JSON using JSONPath. You can find the new action by going to Actions > Tools > Get data from JSON.

How to extract data from JSON using JSONPath

JSONPath is a query language used to extract data from JSON. We highly recommend that you use a tool to help you find the correct JSONPath to extract the data from JSON (https://www.site24x7.com/tools/jsonpath-finder-validator.html).

Handling success / failure

The Success path is executed if at least 1 custom field is filled with data. The Failed path is executed if the JSON data is invalid or no data was saved to any custom field.

If you are saving data to multiple custom fields, we strongly recommend that you check if the custom field has a value using a condition because if your JSONPath is incorrect, the existing data on the custom field is deleted

Request AI model to return the response in JSON

In your prompt, you can ask the AI model to return the response in JSON. You must provide a JSON example that the AI model needs to return.

For example, imagine you have a receipt (image) that contains the custom Tax ID, email, and phone number. You can use AI to read the image and return the response in JSON.

After the AI model generates the response in JSON, use the action “Get data from JSON” to save data to multiple custom fields.

Table of Contents