Exporting data from Bubble to Airtable

Hi all,

New here so please let me know if I’m breaking any forum rules.

I’ve seen quite a few recipes that connect Airtable to Bubble, however most of these recipes take data from Airtable and upload to Bubble. Does anyone know how to set it up the other way around?

I currently have a database on Bubble that I would like to sync to Airtable. Any help would be most appreciated and I’d be happy to pay someone to help us get this set up.

Many thanks,
Saher

Hey Saher! Welcome to the Parabola Community! Your use case is certainly possible with Parabola.

Have you managed to get data into Parabola from your Bubble app? If not, search for Bubble on the righthand Steps sidebar and drag in the Bubble Import Beta step. You need to update the Endpoint URL with your app name and object name. You’ll also want to paste in your API Key in the Bearer Token field.

For exporting data to Airtable, you’ll use our generic API Export step. The Endpoint URL will look something like this:
https://api.airtable.com/v0/appxxxxxxx/yyy
Make sure to update the URL with your App ID and specify your endpoint.

The Authentication Method will be Bearer Token. You’ll paste in your API Key into the Bearer Token field.

Hope that helps get you started. Let me know how that goes!

1 Like

Yup! I’ve created a one way sync from MongoDB to Airtable with the API Export as the last step. After some trial & error, works like charm!

In your Airtable base, click on “help” → API Documentation and it will generate the exact JSON that you need to use!

1 Like

Hi, what should the body for an Airtable API export look like in terms of formatting/choosing the right snippet?

““records”: [
{
“id”: “recWP2vG050X6IeCc”,
“fields”: {
“Units”: 5
}
}
]”

I was trying something like this to update the “Units” field of the record in “id”. I am calling the right API endpoint with Bearer Token. Parabola is not returning any response, while Airtable is showing no change.

Thanks,
Jan

Hi Jan - The Body should look something like this:

 {
      "fields": {
        "Name of Airtable Field": "{Name of Parabola Column}",
        "Name of Airtable Field 2": "{Name of Parabola Column 2}"
      }
    }

For your case, I would imagine it would look something like this:

{
      "fields": {
        "id": "{Name of Parabola Column containing Airtable ID}",
        "Units": "{Name of Parabola Column containing the Units data}"
      }
    }

Does that help?

1 Like

Hi Sachi,

Thanks for getting back to me so quickly.

Unfortunately, I don’t quite understand it yet. At the moment, I’m just testing an empty flow with only the API export block trying to update a record in a small test Airtable base.

“{
“fields”: {
“SKU”: “ShakeMixer”,
“FBA Stock”: 1100
}
}”

is my body now where “SKU” and “FBA Stock” are fields in the Airtable base, which is correctly linked and using the API key as Bearer Token. I’m using the PATCH method. Is that not how it works?

What I’m trying to accomplish based on the Airtable export:

Replacing a column in Airtable with a column based on a CSV import according to rows matched by the article ID (SKU). Do you also have advice when it comes to which flow elements to use here?

Thank you,
Jan

Ah, if you just have a single API Export step on your flow, Parabola won’t actually export anything - You need to have at least one import step so Parabola has some data to send through. If you look at the Run History in your published dashboard, you’ll see that we exported 0 rows.

Here’s what I recommend doing:

  1. Use our Airtable Source to import that Airtable base you’re trying to update. We might not end up using this step in your flow but it’s helpful to reference Airtables column names
  2. Use our CSV File step to import a sample CSV that you’ll use to update your Airtable. You should make sure to have the columns: SKU and FBA Stock
  3. Connect your CSV File step to your API Export. When you do that, you’ll see two tabs appear in the step: Input and Results. This is how you’ll be able to see the data Parabola is sending to Airtable

Let me know once you have that set up, and I can help you finish configuring your API Export!

1 Like

Hi Sachi, thanks for your help so far!

Now I can run the flow and it’s sending data but returning a 422 error:

Now, I seem to be communicating with the Airtable API in the wrong format. I think it might be related to record IDs. Do they have to be passed in the request? Actually, I would like to match the SKUs (product IDs) with the Airtable “SKU” field/column and thus update the “FBA Stock” field in Airtable using the CSV “FBA Stock” dolumn.

My body now is simply this:

{
      "fields": {
        "SKU": "{SKU}",
        "FBA Stock": "{FBA Stock}"
      }
    }

If you can head me in the right direction to get successful exports and achieve that data exchange, I would be very thankful.

You’re getting close! I think I misunderstood your initial question. You were on the right track in including the record id in your body.

Just to confirm, you’re trying to update FBA Stock, but all the SKUs already exist in your existing Airtable right? Meaning, you’re using PATCH to update records instead of POST to create new records?

In that case, you’ll want to use the Join step to combine your CSV File with your Airtable Import. That way, you can add the Airtable id into your CSV File. This is how we’ll tell Airtable which record to update.

Connect your CSV File and then your Airtable Import step into a Join step like so:

Configure that Join step to match up your rows by SKU. Make sure your Primary Table is the CSV File. Now, you should see the Airtable records id added as a column to your table.

Once you have that, your API Export Body should actually looks like this:

{
  "records": 
  [
    {
      "id":"{id}",
      "fields": 
        {
          "SKU":"{SKU}"
          "FBA Stock":{FBA Stock}
        }
    }
  ]
}

Let me know how that goes!

1 Like

Thanks again for your help, Sachi!

Now, I’m onto this error after also including the IDs in the Airtable import and following API export:

{
  "error": {
    "message": "You must provide an array of up to 10 record objects, each with an \"id\" ID field and a \"fields\" object for cell values.",
    "type": "INVALID_RECORDS"
  }
}

Body looks like that now:

{
  "records": 
  [
    {
      "id":"{id}",
      "fields": 
        {
          "SKU": "{SKU}",
          "Sales Velocity": "{Estimated Sales Velocity}",
          "Mediary Stock": "{FBA  Prep. Stock}"
        }
    }
  ]
}

It looks like you need to filter out the rows that have a blank id.

If you look at the sent data you got back in the error message, you’ll see that we tried sending "id":"" since there’s no ID attached to the SKU: "HU-UI84-F37D"

To be able to use a PATCH, all records will need an ID. If you’re adding new SKUs, you’ll want to use a POST to create new records for those instead.

1 Like

Ok, that fixed that. Now, I’m receiving a 422 “INVALID_VALUE_FOR_COLUMN” for the Sales Velocity field. First, it made sense, since I was trying to paste a number with “,” as the decimal point. I quickly changed that using Text Extract, but the error didn’t get fixed, even after including Magic Cleaning or JSON Flattener (or both). “Typecast:true” was going to be another attempt.

I also thought it might be related to the “” around the number values, which are not present in the Airtable API JSON snippets, but those cannot be removed, because Parabola will not let me save/execute the flow without them.

Body:

{
  "records": 
  [
    {
      "id":"{id}",
      "typecast": true,
      "fields": 
        {
          "SKU": "{SKU}",
          "Sales Velocity": "{Sales Velocity (SB) (1)}",
          "Mediary Stock": "{FBA  Prep. Stock (1)}"
        }
    }
  ]
}

… and I’ve run out of credits. :smiley:

Hey Jan!

Just reset your credits.

If the Airtable API docs have any values not wrapped in quotes, then you should omit them from Parabola as well.

Most likely, Parabola is picking up the blank value in your last row when you remove the quotes.

Without quotes in the JSON, you need to have the word null instead of a blank. So, use the Regex step, use ^$ as the expression, and replace it with the word null. Apply that to any column that you need to send without quotes!

Let me know If that fixes it.

1 Like

Hey Brian,

Thank you very much!

I added the REGEX step, added the null values but the JSON is still invalid:

It looks like the values in your FBA Prep. Stock column has a space in lieu of a comma, like this: 1 000.

To fix this, in the same RegEx step that you’ve already added, can you add this rule:

This will remove anything that’s not a digit from that column.

Heads up: Since the RegEx step applies the rules from top to bottom, you’ll need to add this rule above the rule this rule:

Since you can’t rearrange the order of rules yet, you’ll need to do a little rebuilding of that step.

Keep us posted on how that goes!

1 Like

That was it, got it working, thank you very much for all the help! :smiley:

2 Likes

Woohoo! No problem, Jan!