JSON, Version: FM 18 or later

JSONQuery at FM-DiSC

Update 16 Sep 2024: JSONQuery 2.0 is now available.

When / Who / Where

On Friday, January 14, Steve Senft-Herrera and I presented JSONQuery at FM-DiSC (FileMaker Developers in Southern California).

Useful Links

Recording of the presentation: https://www.youtube.com/watch?v=dztdZrHdrUQ

Current version of JSONQuery:  CF_JSONQuery_20211130_0120_PUBLIC.fmp12.zip

Our recent two part in-depth interview series:

Kevin Frank’s demo file from the presentation: jsonquery-sandbox.zip

More information re: JSON + FileMaker:

15 thoughts on “JSONQuery at FM-DiSC”

    1. Thanks, Ben! I will be working on the remaining QA for the upcoming version this weekend. I think that after that plus one more weekend of similar work, it will be ready for release. Glad you are interested in the PATH function. It was your comment on the first post in the series that inspired it!

  1. Is there a repository for getting the latest version of JSONQuery or do individuals need to come to this site to download the file?

  2. Just starting to play with this CF but am having difficulties. I have validated that the json I’m using is good but any/every JSONQuery I use only returns a pair of brackets – thoughts?

    1. Hello Karstyn. Thank you for trying out JSONQuery, and for reaching out about this. I would be happy to try to help you out with some ideas, tips, or even potentially spot an error if you can provide some detail. At the very least, seeing the parameters that you are supplying to the function, and a statement about what you were expecting to be returned would be an excellent first step towards being able to offer some helpful feedback. Including a small sample of your JSON would also be helpful, if that is possible. Thank you, Karstyn.

  3. Karstyn,

    An empty array as the response indicates that there were no matches for your query.

    Can you please post a) sample source JSON and b) JSONQuery syntax that is returning “[]”?

    Regards,
    Kevin

    1. Thanks for the quick response!

      Here is some cutdown and anonymized json:

      {
         "paging" :
         {
            "next" :
            {
               "after" : "ODg3ZDMwN2MtODQzYi00Mj",
               "link" : "?after=Q&limit=20"
            }
         },
         "results" :
         [
            {
               "url" : "https://xyz.com",
               "submittedAt" : 1717177149663,
               "values" :
               [
                  {
                     "name" : "time_zone",
                     "objectTypeId" : "0-1",
                     "value" : "EST"
                  },
                  {
                     "name" : "intro_to_fm",
                     "objectTypeId" : "0-1",
                     "value" : "June 4, 2024"
                  }
               ]
            },
            {
               "url" : "https://xyz.com/register/",
               "submittedAt" : 1712084618623,
               "values" :
               [
                  {
                     "name" : "time_zone",
                     "objectTypeId" : "0-1",
                     "value" : "EST"
                  },
                  {
                     "name" : "intermediate_fm",
                     "objectTypeId" : "0-1",
                     "value" : "June 5-6, 2024"
                  }
               ]
            }
         ]
      }

      and the JSONQuery I tried:

      JSONQuery ( JSON ; "results" ; "MATCH_ALL" ; "" ; "" ; "LIST (results.submittedAt )" )

  4. I would recommend simplifying things by first extracting the results array, and then running your query against that simplified input. E.g.,

    Let ( x = JSONGetElement ( JSON ; "results" ) ;
          JSONQuery ( x ; "" ; "MATCH_ALL" ;
          "" ; "" ; "List ( submittedAt )" )
    )

    Hope this helps,
    Kevin

  5. I agree with Kevin. The first argument supplied to JSONQuery should be the array that you are querying. The example that Kevin posted looks good to me. I’d suggest giving it a try. Thank you Karstyn for providing details, and thank you Kevin for providing a great answer.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.