Jump to content

Update a record using CWP


This topic is 3078 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

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?

Link to comment
Share on other sites

  • 2 weeks later...

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

Link to comment
Share on other sites

This topic is 3078 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.