Newbies kirkroyster Posted March 3, 2021 Newbies Posted March 3, 2021 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
MonkeybreadSoftware Posted March 3, 2021 Posted March 3, 2021 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.
comment Posted March 3, 2021 Posted March 3, 2021 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.
Newbies kirkroyster Posted March 3, 2021 Author Newbies Posted March 3, 2021 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
comment Posted March 3, 2021 Posted March 3, 2021 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).
bcooney Posted March 3, 2021 Posted March 3, 2021 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/
Recommended Posts
This topic is 1358 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now