Forum Discussion
_anomDiebolt_
7 years agoQrew Elite
>Code running client-side ... probably has less likelihood of breaking down
In my experience QuickBase servers and broadband connectivity are so reliable today that you never have problems calling the QuickBase API from client side code - with possibly one exception.
If you attempt to call the QuickBase API client side in a loop like so:
for (var i=0; i < n; i++) {
$.get(... ?act=API_AddRecord ...);
}
as n increases you will eventually get an error something to the effect of "waiting for an available socket" and your browser tab will stop responding. The solution in this particular case would be to make one call to API_ImportFrom CSV instead of n calls to API_AddRecord. In the general case of making a large number of API calls is to use an async iterator which allows you to iterate over promises (AJAX calls) without flooding the network with a large number of simultaneous requests.
I just wanted to clarify that users should not shy away from using JavaScript client side because of your mention of "API retries" or other server or network availability issues.
In my experience QuickBase servers and broadband connectivity are so reliable today that you never have problems calling the QuickBase API from client side code - with possibly one exception.
If you attempt to call the QuickBase API client side in a loop like so:
for (var i=0; i < n; i++) {
$.get(... ?act=API_AddRecord ...);
}
as n increases you will eventually get an error something to the effect of "waiting for an available socket" and your browser tab will stop responding. The solution in this particular case would be to make one call to API_ImportFrom CSV instead of n calls to API_AddRecord. In the general case of making a large number of API calls is to use an async iterator which allows you to iterate over promises (AJAX calls) without flooding the network with a large number of simultaneous requests.
I just wanted to clarify that users should not shy away from using JavaScript client side because of your mention of "API retries" or other server or network availability issues.