Work in Progress: How To Fetch Data from a specific row in Airtable in a Computed Field

For fetching data from Airtable we will have to use an Async Computed Field

Step 1: Create the Async Computed Field

Mark the async checkbox after creating the New Computed Field

Step 2: Settings of the Flow

In Entire Flow --> Options --> Advance, add the Keys that we will need to identify the Airtable row from where we want to extract the data. In this case, it would be customer_id

Step 3: Generate the function for the async Computed Field

function result({
  customer_id,
}) {
  return fetch(`https://api.airtable.com/v0/appZTPe3D7r1qi7KA/Report%20Results/${customer_id}`, {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer API_KEY',
    },
  }).then(response => response.json())
    .then(data => {
      const d = data.fields

      return d
    })
}

Step 4: Getting the Data in the Response

The Data is going to come as a JSON object, so we only need to access the fields we need by dot notation for example d.customer_id or d.main_score

        "customer_id": "recGQGPy26Wh7nDBc",
        "site_design_text": "This website is very good. The design is clean and clear with excellent use of spacing, colour and animation.

\nThis website stands a very strong chan...",
        "main_comment": "This is a very good website",
        "main_score": 100,
        "company_url": "trysavvy.com",
        "company_name": "Savvy",
        "site_design_score": 25,
        "Flow URL": "https://flows.trysavvy.com/flow/Py2LmcoIEINqAAo1Wint?customer_id=recGQGPy26Wh7nDBc"
    }
  

Last updated