Hello everyone,
I’m trying to set up a scenario in Make that counts all the paginations of an API. My goal is to transfer all the elements from the API to a board in Monday.com. However, I’m facing some issues:
- Pagination: Currently, it seems that only the elements from the first page are being created. I want to ensure that my scenario accounts for all pages of the API and creates the corresponding items in Monday.com.
- Element Creation: Additionally, I want to set up a filter that identifies elements that do not already exist in the board before creating them. However, I find that I must include the condition “Exists” in the filter, which doesn’t seem logical for my use case.
Could anyone guide me on how to configure my scenario to achieve this? Any help or tips would be greatly appreciated!
Thank you!
pagination-blueprint.json (24.7 KB)
1 Like
Hello @jose2023,
The first thing is to identify which type of pagination is implemented in your API response.
⇒ 5 API Pagination Techniques You Must Know
⇒ Unlocking the Power of API Pagination: Best Practices and Strategies - DEV Community
If your pagination type is “Offset and Limit Pagination” OR “Page-Based Pagination”. If there are “Cursor-based pagination” applied then stop from here and read this Pagination: condition on iterated item count for variably sized pages (can't use page size ✕ page count)
“Offset and Limit Pagination” OR “Page-Based Pagination”.
The repeater concept only applies when you know the number of pages.
A couple of important community posts Repeaters based Pagination.
- Master Pagination Techniques of API in Make (Formerly Integromat
- Pagination: Repeaters
- Repeater and aggregator with api pagination
Also recommend you to first search it on Community itself and also on Google.
There are lots of solutions already there based on different types of questions.
1 Like
Hi @jose2023
From the first module you will get the total number of pages:
In repeater
Since it has a private API document, you can refer to the API document and check where you have to pass the mappings for handling multiple pages, and then use the API to pass the page number, mapping {{i}}
from the repeater to iterate through each page.
Finally, use the array aggregator to compile all the data, setting the repeater as the source module. This will gather all the data into one array for easy mapping.
Best regards,
Msquare Automation
Platinum Partner of Make
@Msquare_Automation
1 Like
Hello, thank you very much for your time; you always provide a response full of knowledge, and I truly appreciate it.
I tried the scenario, and it seems I’m close to achieving it. However, I’m still only importing a single item into Monday, The scenario just creates one item for me in Monday, but the array it is already working with each page.
Could you give me another push to get closer to success, please?
1 Like
Hi @jose2023
First adjustment:- replace mapping in repeater from “CurrentPage” to “Total Pages”
Second Adjustment:- Please utilize iterator after aggregator and then map the items from iterator in Monday module.
Best regards,
Msquare Automation
Platinum Partner of Make
@Msquare_Automation
1 Like
Thank you so much, I really appreciate it. If I wanted the columns of the created items to be updated, should I add a router to another monday module? (For example, if the date, ID number, or any field in the API of that item were to change).
1 Like
Hi @jose2023
Glad to know that your issue is resolved now. We would really appreciate if you mark the answer as solution if it helped you. This will keep the community healthy and organized.
You can make use of the following module to to update any column of an item in monday.com
Best regards,
Msquare Automation
Platinum Partner of Make
@Msquare_Automation
I just verified that the array is changing pages, but I can’t get monday.com to create all the items from all the pages.
Hi @jose2023
You will have to iterate through the array after the array aggregator to create items one by one.
Best regards,
Msquare Automation
Platinum Partner of Make
@Msquare_Automation
Yes @Msquare_Automation , I’m very close now. The only issue is that it only creates the first item from each bundle.
Hi @jose2023
Can you share the output bundle of iterator module
Best regards,
Msquare Automation
Platinum Partner of Make
@Msquare_Automation
Hi @jose2023
Since you’re aggregating the data array, the output from the iterator will also be an array. Therefore, you’ll need to use an additional iterator to process it.
Best regards,
Msquare Automation
Platinum Partner of Make
@Msquare_Automation
I have tried using a second iterator but then when I try to map the iten name in monday cmodule, the last iterator only shows “total bundles”, “value” it does not shows the specific data