I’ve updated the AppSheetApp API library with a new feature that lets you run multiple API calls at the same time. This addition, building on Martin Hawksey’s original library, allows you to use familiar methods like Add, Delete, Edit, and Find in parallel.
This means you can now say goodbye to App Scripts session timeouts! ![]()
How It Works
The new FetchAll helper function uses App Script’s native UrlFetchApp.fetchAll() method to send multiple requests simultaneously. Here’s a quick look at how to run your methods in parallel:
const AppSheet = AppSheetApp.connect('YOUR_APP_ID', 'YOUR_ACCESS_KEY');
//Run multiple methods in parallel
const responses = AppSheet.FetchAll(
AppSheet.Add('People', sampleData1[] , properties, true),
AppSheet.Delete('People', sampleData2[] , properties, true),
AppSheet.Edit('People', sampleData3[] , properties, true),
AppSheet.Find('People', [], properties, true),
}
//Breakdown and assign each response to individual variables
const [ respFromAdd, respFromDelete, respFromEdit, respFromFind ] = responses
Key Changes
-
FetchAllWrapper: All parallel method calls are now wrapped within the newAppSheet.FetchAll()helper function. -
New Parameter: A fourth parameter,
isAysnc, has been added to the method calls. Setting this boolean totrueconverts the function into a URL request compatible withUrlFetchApp.fetchAll(). By default, this parameter isfalse, so all previous functions will continue to work without any changes.
To use this you can library. Add this Script ID on your App Script Project: 1aXPRqSO_ulCdptqlpKm12o81pdOHUlxnr9n6Gw3AIXk0K8Xc_cNCbx4B
For more details, check out my GitHub repository:
