Hey There, So I have a job that updates the well headers in combocurve on a nightly basis, I default to the PUT request so I upsert in one transaction.
At first I was sending every field, but we trimmed off the custom fields, so they would stop getting cleared out.
Someone on my team recently noticed that even those the custom fields are being sent in our request, they still get cleared out in combocurve, wanted to know if this is something I am doing wrong on my part, or if I don’t send the custom fields on the PUT, combocurve just nulls them on an update?
Good Morning! Have you tried using the PATCH method rather than PUT? The PUT request sends the entire entity through the API (even null fields) and overwrites the data. The PATCH request should only post the changes you are wanting to push and not the entire well header entity.
I see, yeah I am trying to avoid that because I don’t want to have check if a wells previously exists or not for every batch.
But to confirm, the PUT request overwrites all fields regardless if sent in the request or not? So I will need to use some combination of Put and patching to achieve what I am doing without overriding our custom fields.
So I rewrote a portion of my job to only patch wells that we have already loaded inside of ComboCurve.
In my request, I leave off all of the custom fields, but they still seem to be getting overridden with blank values in ComboCurve with a patch request.
Making another GET request to the well to check the values I’m seeing the same custom header values from before and nothing is overwritten besides the expected field value
Is it possible that in your job you make a PUT request after your PATCH? Or would it be possible that you are passing null values to the custom header fields in your PATCH? One other thing what client are you using to access the API?
So after doing more testing, I can confirm my new job with Patching is working appropriately.
I believe the issue came from the table I have in BQ that generates the well, to accommodate needing to send to sets of wells
Insertion of new ones 2. Update existing ones, I created a 2nd table to store the wells that need to be updated and already exist in combocurve, and just adjusted the 1st table to exclude wells that already exist in combocurve.
I cannot confirm it, but my assumption is I did not clear Table #1 yesterday, and those table models regenerate around 12am, where as the combocurve Job runs at 8pm, so basically it just had 1 more run the old way.
Apologies for that, and thank you for thanking the time to test and respond.