Dear callin.io Community,
I'm working with an Airtable module that searches for records, and it's outputting more than 10 bundles. I'm using the Aggregate to JSON module to merge these into an array, which I then need to bulk update using the Airtable API.
The Airtable API has a limitation: it can only update 10 records at a time. If my array contains, for example, 11 records, the API call will fail.
I'm looking for a dynamic way to create multiple unique arrays using the JSON module, where the number of arrays is determined by the total number of records divided by 10.
For example:
- Airtable outputs 23 bundles (1 operation).
- JSON module creates 3 unique arrays (23 / 10 = 2.3, rounded up to 3) (3 operations).
- Airtable makes 3 bulk update calls, corresponding to the number of arrays generated.
Is there a way to group the Airtable module's 1 bundle into groups of 10?
Could a repeater module help with this?
I hope the issue is clear, and I'd appreciate any help. Thanks in advance!
Best regards,
karim
If you need to separate your items into batches of 10 (or any other quantity), the initial step should involve using an array aggregator.
After the data is converted into a JSON string, it can no longer be divided.
Could you elaborate on that further, please?
For further assistance, please provide the following:
1. Screenshots of module fields and filters
Please share screenshots of the relevant module fields and filters in question. This would greatly assist other community members in understanding your context.
You can upload images here using the Upload icon in the text editor:
2. Scenario blueprint
Please export the scenario blueprint file to enable others to review the mappings and settings. You can find the Export Blueprint option by clicking the three dots at the bottom of the scenario editor.
(Note: Exporting your scenario will not include private information or connection keys)
Uploading it here will appear as follows:
blueprint.json (12.3 KB)
3. And most importantly, Output bundles
Please provide the output bundles from the modules. Run the scenario, then click the white speech bubble on the top-right of each module and select “Download output bundles”.
A.
Save the bundle contents to a bundle.txt
file using your text editor, and upload it to this discussion thread.
Uploading it here will look like this:
bundle.txt (12.3 KB)
B.
If you are unable to upload files on this forum, you can alternatively paste the formatted output bundle using one of these methods:
-
Add three backticks
```
before and after the code, like this:```
input/output bundle content goes here
``` -
Or use the format code button in the editor:
Providing the output bundles will enable others to replicate the scenario's behavior, even without access to the external service.
Following these steps will facilitate assistance from the community. Thank you!
9airtable.json (3.8 KB)
12json.json (1.4 KB)
7airtable.json (125 Bytes)
blueprint (7).json (23.7 KB)
Here you go, thanks in advance
Could you assist me with this? That would be greatly appreciated.
Also, if you don't mind, I have another question: can I scrape websites using ScrapeNinja if the website requires a login, for example?
I need to extract the data behind this interface and then input it into a Google Sheets module.
Thanks in advance!
Hello Karim,
Within your search record, you can utilize the Airtable query with embedded variables. This will group your 10 records (you'll need to define the grouping logic). Subsequently, you can loop this search module to execute for each of the 10 distinct records, perhaps by using an iterator that shares the variables for your query search.
You can explore using a formula field to filter your records and isolate a smaller subset of your table. The preceding module can iterate and pass a variable into this formula, enabling you to segment your table into chunks of 10 records maximum.
For instance, add a new column in Airtable named "index", populated with an integer incrementing from 1 to xx for each row.
Then, utilize an Airtable formula to search for records where the {index} falls between x and y.
Here, x and y represent your variables, which will change for each operation based on the preceding iterating module.