Newbies Stephen Fox Posted September 18, 2015 Newbies Posted September 18, 2015 Hi, I've currently got a script that takes JSON data and using the Filemaker API, puts it into my Filemaker database. This works great, I run my php script and it fills my filemaker table with all the pulled in data.The issue I have is when a record in the table needs to be updated, the api skips the record it as there is a unique field in the filemaker database (my chosen key field) as it already exists. I can get round this by using php to create a csv from the Json, then run a script to import into filemaker matching on the unique field, but it seems more of a hack than a robust solution. Is there a way of grabbing the internal record id from filemaker when creating it so it can be used to update the record if it already exists? Or is there another way of updating I haven't though of through the api?
webko Posted September 28, 2015 Posted September 28, 2015 You will be using a foreach statement to cycle through the data... An error will be returned when an insert fails - branch at that point to perform a Find using the ID, to return the -recid which can then be used for an update call instead. Hope this helps Cheers Webko
Recommended Posts
This topic is 3601 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