cancel
Showing results for 
Search instead for 
Did you mean: 

Build Apps not considering pagination parameter of REST API

souvikroy
Participant
0 Kudos

I am working on developing an application using the cloud foundry APIs in Build Apps. The API details ( List of CF spaces ) can be found here :

https://v3-apidocs.cloudfoundry.org/version/3.78.0/#list-spaces

I have maintained the above API details as a destination and using the destination in my Build Apps. The API has the default page size as 50. So, in my Test Data Entity screen, it fetches only first 50 spaces as shown below:

I need to bring all the spaces. So, I tried below. Under Relative path and query, I added below formula.

After adding above, my Test Data Entity screen appears as below, where I passed Page Size as 300 and Page Number as 1 .

Now, with the above values, I was expecting, the result should fetch 300 spaces per page but still it is considering only the first 50. The response is same as earlier. Please refer below screenshot.

When I use postman to test this API and add the parameter per_page = 300, it works as expected as shown below.

Postman Response

Do you have any hint for me as I could not figure out what I am doing wrong.

Note: When I am maintaining the entire URL( including per_page parameter value) as destination, then it works. But I do not want to hardcode per_page parameter value in destination.

Accepted Solutions (1)

Accepted Solutions (1)

Dan_Wroblewski
Developer Advocate
Developer Advocate

Works for me

My formula for the list action is

"/v3/spaces" + "?per_page=" + query.pagination.pageSize
souvikroy
Participant
0 Kudos

Thanks daniel.wroblewski , it worked when I maintained the destination like the way you did or up to V3 and maintain the remaining part of URL in the relative path. But, if I maintain the destination up to spaces and start the relative path with "?", then it does not work.

Answers (3)

Answers (3)

Dan_Wroblewski
Developer Advocate
Developer Advocate

souvik.roy2 If you put the path of the call in the destination, yes, the same formula doesn't work and you have to add a slash before the question mark

"/?page=1&per_page=2"
souvikroy
Participant
0 Kudos

Hi daniel.wroblewski I tried "?per_page" + query.pagination.PageSize and also "?per_page=" + query.pagination.PageSize . But still it did not work. Still it is considering only default page size.I even tried static text "?per_page=500" on the relative path but still it did not work. When I am checking the inspector, I see the ?per_page=500 does not get added at the end as shown in screenshot below.

Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos

Doesn't your formula have to be:

?per_page" + query.pagination.PageSize