« Checking out Search f… | Home | MBS FileMaker Plugin,… »

Using JSONPath in FileMaker

For the upcoming MBS FileMaker Plugin 13.5 release, we add three new functions:

JSONPath queries can be used in FileMaker to work with JSON data, which is increasingly common in modern application development. FileMaker allows you to work with JSON data using the JSON functions introduced in FileMaker 16 and later versions as well as with JSON functions in our plugin. JSONPath queries can be useful in the following ways:

  1. Extracting Data from JSON:
    JSONPath queries can be used to extract specific data from a JSON object. For example, if you have a JSON document representing a customer's information, you can use JSONPath to extract the customer's name, email, or any other relevant data.
  2. Filtering JSON Arrays:
    When you have a JSON array of objects, JSONPath can be used to filter the array based on certain conditions. For instance, you can filter a list of orders to only show those with a specific status or date range.
  3. Transforming Data:
    You can use JSONPath to transform JSON data within FileMaker. For example, you can use JSONPath to modify the structure of a JSON document, adding or removing elements as needed.
  4. Conditional Logic:
    JSONPath queries can be used in combination with FileMaker's conditional logic to create dynamic scripts and calculations. You can make decisions based on the data extracted via JSONPath.
  5. Integration with External APIs:
    Many external APIs exchange data in JSON format. JSONPath can be used to parse and extract data from API responses, making it easier to integrate external services into your FileMaker solution.
  6. Data Import and Export:
    JSONPath queries can be used when importing or exporting JSON data. You can specify how to map JSON data to FileMaker fields and vice versa.

Here's a basic example using the JSON Path function in FileMaker with MBS Plugin:

result = MBS("JSON.Query"; json; "$.store.book[?(@.author =~ /Evelyn.*?/)]"; 0)

This query extracts the name of the customer from a JSON object stored in the `json` field.

You may want to learn a bit about our JSON.Query function, about JSONPath and especially the implementation we use: JsonConsJsonPath.

Overall, JSONPath queries in FileMaker provide a powerful way to interact with JSON data, allowing you to work with data structures that are common in web APIs and modern data exchange formats.

Please try the new plugin soon (currently in beta testing) and let us know if you have any questions.

18 10 23 - 09:30