Beginner question but URGENT: How to show column fields according to the condition

I am using GET API from Airtable and getting this resoponse

{
  "records": [
    {
      "id": "recJhdFN4CArTSUlJ",
      "createdTime": "2024-02-28T17:57:52.000Z",
      "fields": {
        "Name": "LEO2",
        "version (from Car Data | Live)": "LR",
        "model (from Car Data | Live)": "Model Y",
        "brand (from Car Data | Live)": "Tesla",
        "Carrier": [
          "recccy20LvRga8PBS"
        ],
        "Carrier Hub": [
          "recykbUe1mMcYBbEZ"
        ],
        "E-mail (from Carrier)": [
          "hafizaliimrankhan@gmail.com"
        ],
        "Address (from Carrier Hub)": [
          "Am Tiefen Grund 25, 14612 Falkensee, Germany"
        ]
      }
    },
    {
      "id": "recKXCuBh9n2h7dMj",
      "createdTime": "2024-02-28T17:57:52.000Z",
      "fields": {
        "Name": "leo1",
        "version (from Car Data | Live)": "SR",
        "model (from Car Data | Live)": "Model 3",
        "brand (from Car Data | Live)": "Tesla",
        "IM Carrier Hub": [
          "reciiMW5lTNnJKIpy"
        ],
        "IM Carrier": [
          "recccy20LvRga8PBS"
        ],
        "Address (from IM Hub)": [
          "Dammstraße 25, 44145 Dortmund, Germany"
        ],
        "Carrier Hub": [
          "recEdpU0EWTapONMu"
        ],
        "E-mail (from IM Carrier)": [
          "hafizaliimrankhan@gmail.com"
        ],
        "Address (from Carrier Hub)": [
          "Seelandstraße 15, 23569 Lübeck"
        ]
      }
    }
  ]
}

The usecase is, there are two types of Carriers.
Carriers and intermediary carriers.
And both of these carriers have different pickup locations.

The condition I want to create it,
when current User's email is IM carrier show address Address (from IM Carrier Hub)
OR
when current User's email is Carrier show address Address (from Carrier Hub).

My questions is where should I do it? and how should I do, i have had tried many ways, unable to figure out how.

Thanks

Hi and welcome!

Based on what you provided, I would suggest a JS transformer in your GET that pushes all the fields in the API response into a straightforward (flattened) table-like object, and then use the "Query JSON with SQL" resource to show what I want to show in a table using CASE statements. Further, if you don't want all data for all users, the transformer could include logic to select the particular fields (and/or records) to be returned based on the current user's attributes.