PATCH API export to airtable not working (no error)

Hi!

I am importing data from a MONGO DB and exporting it to AIRTABLE. I’m using several exports:

  • A POST to create new records
  • A PATCH to update some values from the already existing ones.

This was working perfectly but two months ago we created 2 new fields in the MongoDB and now I would like to update the records already existing in the Airtable DB, I thought I would use the same PATCH export I was using and just include the 2 new fields, but this didn’t seem to work. I only get patched the field that already existed when I configured the Flow.

I tried to replicate the PATCHpart in a new flow:

  1. Import MongoDB
  2. Import Airtable
  3. Match by ID
  4. Filter and clean data
  5. Export with PATCH

But the same happens, the records don’t get updated in Airtable although the data exists in MongoDB!

The weird thing is I don’t get thrown any error, the flow runs but does not do anything.
Request https://api.airtable.com/v0/appwesVyLq5fbDo20/Lends/{id (1)} \
Body
`

{
 "fields": {
  "finished_where (1)": "{finished_where}"
  } 
}

`

Did someone experience this before?

Hey @Oriol_Segarra,

There are a few things here that are worth exploring. When making a PATCH request to your Airtable base, can you try moving the ID of the record you want to update from the endpoint URL to the JSON body?

https://api.airtable.com/v0/appwesVyLq5fbDo20/Lends

{
	"records": [{
		"id": "{id (1)}",
		"fields": {
			"finished_where (1)": "{finished_where}"
		}
	}]
}

Can you also check to see if your finished_where (1) column in Airtable matches the correct field type to accept strings? Depending on the values of your {finshed_where} column in Parabola, it’s possible there may be a mismatch.

Once you make those changes in Parabola, click “Update Live Version” and run your flow. Feel free to pass along any information the Run History provides!

1 Like

Thanks for your reply! I tried what you said but didn’t work. I also double checked the type of “finished_where (1)” and its simple text, so I guess that’s string.

I’m not sure what it could be

Thanks for trying that out. Not to worry, let’s explore a few more things.

Can you confirm if a finished_where (1) column exists in your Airtable base? If so, click into your Pull from Airtable step and refresh it. Otherwise, it’s possible that your JSON body needs to be flipped:

{
	"fields": {
		"finished_where": "finished_where (1)"
	}
}

Once complete, click “Run Flow” to publish your flow if you haven’t already. This should take you to the dashboard where you can select “Run Flow Now”. Export steps can only run if a flow is published.

If that doesn’t work, take a screenshot of the logs in your Run History. That will help point us in the right direction.

So… right now I can’t test… I don’t know what happened but right now I don’t see any of my flow blocks :laughing:

I think I misunderstood you, I didn’t run the flow not to waste credits, I thought that with the update I could see what the results would be, am I wrong?

Oh no! You may want to zoom out and pan around your builder canvas. Your steps are hiding in there somewhere. Let me know if you’re still having trouble.

Your new flow needs to be published in order for the Send to an API step to work—even if data appears when clicking into that step.

After you run your flow, your data should be sent to Airtable. If any errors occur, they will be logged in the Run History.

Ok now I see the errors. The configuration I used is the one you recommended me in the last answer

Request sent:

{
  "data": {
    "records": [
      {
        "fields": {
          "finished_where (1)": ""
        },
        "id": "recTvwS4OJxvEhCEI"
      }
    ]
  },
  "headers": {
    "Authorization": "Bearer XXX"
  },
  "method": "PATCH",
  "url": "https://api.airtable.com/v0/appwesVyLq5fbDo20/Lends"
}

Response:

{
  "error": {
    "message": "Unknown field name: \"finished_where (1)\"",
    "type": "UNKNOWN_FIELD_NAME"
  }
}

the name of the field in airtable is finished_where but when I combine both tables (MongoDB and Airtable) the column from airtable gets the name of finished_where (1) which field name should I put in the body?

Ok now its working ! I used the field name from airtable and its patching it :slight_smile:

3 Likes

Awesome! So glad to hear it’s working now. :slight_smile: