March 3, 20214 yr Newbies I need to send a JSON string containing 1000+ objects with data to be replaced into fields in a Filemaker layout. Currently looping a NodeJS method which is taking a large Node heap allocation, and clearly the ideal way to do this is to send the data for all records in one request and loop through it within Filemaker via a script. Closest thing I can see in the documentation is - run a script and pass a parameter that is the JSON string. But what is the size limitation on the parameter? Anyone actually performed a bulk operation in this manner? Kirk
March 3, 20214 yr Parameters have a size limit. Maybe you like to check JSON functions in MBS FileMaker Plugin to process them. They are made for high performance. Especially you can check JSON.Parse to parse once and query often. And of course JSON.Import for automatic import into records, where the plugin would create table and fields and then import data.
March 3, 20214 yr 11 hours ago, kirkroyster said: But what is the size limitation on the parameter? If the script is performed server-side, then there is a limit of 1 million characters. This is documented at: https://help.claris.com/en/pro-help/content/running-scripts-on-server.html I could not find any documented limit for scripts performed locally. I tend to think the only limit is available memory. This is supported by some user reports.
March 3, 20214 yr Author Newbies Exactly what I was looking for. I can get the job done within 1 million characters (JSON string size in the script parameter). Sorry that I did not find that myself. No way I'm going to bring 3rd party plugins into the equation as I'm convinced a Filemaker script can loop through the content of a JSON string and update records accordingly. If anyone has a good example of a script that parses JSON and loops through with record updates, fantastic. That's what I'll be building near term. Data API call that initiates the server side script passing a stringified JSON object array containing the values to update into the existing Filemaker records. Kirk
March 3, 20214 yr 4 minutes ago, kirkroyster said: If anyone has a good example of a script that parses JSON and loops through with record updates, fantastic. I think it depends on how exactly the "update" part is supposed to work. If the script needs to find each record to be updated, this could get awkward. Filemaker has a built-in mechanism for updating records using the Import Records script step. However, JSON data cannot be imported (at least not directly).
March 3, 20214 yr we do this all the time. typically, we set the payload in a Receiver record and call a script that sends the data to our Controller to process the records transactionally. You can see how here: https://www.geistinteractive.com/products/karbon-filemaker-application-framework/
Create an account or sign in to comment