This site uses tracking cookies. By using this site, you agree to our Privacy Policy. If you don't opt in, some parts of the site might not function.
Blog
Home / Blog / FileMaker / How to Automatically Create Variables from JSON Data in FileMaker
08Jan 2018

How to Automatically Create Variables from JSON Data in FileMaker

About the Author

Mislav Kos Mislav Kos

Mislav is a FileMaker developer and a Senior Technical Project Lead at Soliant Consulting.

Comments (6)

Tim Anderson - January 8, 2018

Thank you, I have created a couple of script that does this, very handy to have as a cf

Reply
Vincent - January 8, 2018

Hi, that’s nice but it uses (and there’s no alternative) the Evaluate function that can get very slow if the variable content is a big text.
This would be resolved if we finally get from FMI a function to create variables on the the fly, specifically made for this, so optimized for it, and hence fast.
Please vote that idea, so people will be able to avoid Evaluate for this, and get much better speed :
https://community.filemaker.com/ideas/2253

Reply
Esaïe Bergier - January 11, 2018

Thx a lot for this fonction.

I do a small modification on it for add the possibility to choice “local” or “global”

I post it on the french community https://www.fmsource.com/files/file/85-création-de-variable-à-partir-de-json/ , I’m sure that can help a lot of people

Reply
Charlie - October 10, 2018

Hello and thank you for sharing. I’m currently working with JSON and I’m wondering what is wrong with my syntax… the function results in error 5. My example is as follows:

[

  { “firstName”:”John”, “lastName”:”Doe” },
    { “firstName”:”Anna”, “lastName”:”Smith” },
    { “firstName”:”Peter”, “lastName”:”Jones” }

]

Thank you

Reply
Charlie - October 10, 2018

I believe the culprit was extra whitespace. Great function!

Reply

Leave a Reply