Skip to content
Airtable batch upda...
 
Notifications
Clear all

Airtable batch update via API call

9 Posts
3 Users
0 Reactions
4 Views
karimzynera
(@karimzynera)
Posts: 6
Active Member
Topic starter
 

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

:slight_smile:

 
Posted : 13/02/2024 5:39 pm
samliew
(@samliew)
Posts: 293
Reputable Member
 

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.

 
Posted : 13/02/2024 10:45 pm
karimzynera
(@karimzynera)
Posts: 6
Active Member
Topic starter
 

Could you elaborate on that further, please?

 
Posted : 14/02/2024 5:25 pm
samliew
(@samliew)
Posts: 293
Reputable Member
 

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:

Screenshot_2023-07-10_111039

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.

Screenshot_2023-08-24_230826

(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”.

Screenshot_2023-10-06_141025

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:
    Screenshot_2023-10-02_191027

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!

 
Posted : 14/02/2024 5:59 pm
karimzynera
(@karimzynera)
Posts: 6
Active Member
Topic starter
 

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

 
Posted : 14/02/2024 10:03 pm
karimzynera
(@karimzynera)
Posts: 6
Active Member
Topic starter
 

:slight_smile:

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!

 
Posted : 15/02/2024 2:39 am
Florian
(@florian)
Posts: 4
New Member
 

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.

 
Posted : 16/02/2024 5:19 am
karimzynera
(@karimzynera)
Posts: 6
Active Member
Topic starter
 

Hi, thanks for the response.

Could you please provide more details? To be candid, I'm not entirely grasping your point.

Is this what you were referring to?

 
Posted : 16/02/2024 12:57 pm
Florian
(@florian)
Posts: 4
New Member
 

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.

 
Posted : 16/02/2024 4:56 pm
Share: