62
Views
6
Comments
Solved
sync data from an API
Question

Hello All,

I have an API that is returning me a list employees with their details. I am syncing the data from this API to an entity. The problem here is I don't know how many records does this API return. When I did the sync for the first time, it synced 100 records. I am running that timer again and again to sync the remaining data but the timer is getting stopped in 3 seconds. I am not sure why is this happening. I checked the error logs but there are no errors.

How can I sync all the data from the API to the entity? How will I know if I have fetched all the data from the API.

Thanks in advance..

2024-04-05 11-04-57
Krishnnambal
 
MVP
Solution

Hi guys,

The issue is solved. The API itself is providing details such as page number, page size, total records, apart from the actual data. I have now found a fix to understand if the full set of records have been returned or not.

2020-09-21 11-35-56
Sachin Waghmare

Hi Krishnnambal,

Did you checked that you have more records to sync into the entity before you ran the timer second time? It could be one of the reason that you don't have more records to sync and that's why second time timer got ended with in 3 seconds.

Thanks & Kind Regards,

Sachin

2024-04-05 11-04-57
Krishnnambal
 
MVP
Hi Sachin, I don't know how to find that out. The API is returning only a list.. and, not the count. Will 'List.Length' property provide the answer?
2020-09-21 11-35-56
Sachin Waghmare

Yes, it will work. Please refer the below link to support my answer :)

https://www.outsystems.com/forums/discussion/63566/count-data-received-from-api/


2024-04-05 11-04-57
Krishnnambal
 
MVP

Hi, I tried this out but the length property is also returning me only 100 records.

2022-01-13 08-29-52
Saravanan Santhanam

Hi Krishnambal,

Did you try hitting API separately to validate the count of records it's returning? When you do that you will get to know the total amount of records returned by the API for the particular request, then try running the timer and validate whether the previous API count and one triggered by the timer and saved in an entity are the same counts. 

Regards,

Saravanan Santhanam.

2024-04-05 11-04-57
Krishnnambal
 
MVP
Solution

Hi guys,

The issue is solved. The API itself is providing details such as page number, page size, total records, apart from the actual data. I have now found a fix to understand if the full set of records have been returned or not.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.