Loading Airtable based on custom variable

How do I dynamically load different Airtables based on custom variables?

Per user, I defined a corresponding Airtable base ID for their content. If a certain user visits a table, I want to dynamically display this airtable, and this overwrite / replace the variables that are being loaded by default.

These are the ones to overwrite right before the table loads:

window['table1']['baseId']
window['table1']['tableName']

Is there a way to do this with custom code? I havent found a solution yet.

A very simple way I am trying is:

<script>
window.addEventListener('DOMContentLoaded', (event) => {
    // Your code to change baseId and tableName goes here...
    window['table1']['baseId'] = '1233445';
    window['table1']['tableName'] = 'project_matches';
});</script>

However, this does not seem to work perfectly (the original table still loads), presumable because the variables are determined before I can change them. How can I change this?

@nnnniek Unfortunately we don’t allow this to happen as it would open users bases for the entire world and would be a big security issue.

Why would you need base/table per user vs having data in one table and having user identifier in the table

Hi arthur, makes sense, thanks! I want to have multiple users editing their airtables at the same time, and dont want to run into tha AIRTABLE api rate limits.

I will think of a workaround.

Niek

We have the rate limits covered should not be a problem. How many parallel edits will you have ?

I am looking at 50+ people editing one specific table at the same time. If you got it fixed, that would be amazing! I read somewhere that airtable is not scalable because of the request limit per base. But if you circumvent the 5/second then that’s perfect!

Niek

I think we should be good I would suggest you testing it :slight_smile:

1 Like