Forum Discussions

While Loop using a ...
 
Notifications
Clear all

[Closed] While Loop using a REST API in VBCS

3 Posts
2 Users
0 Likes
170 Views
Posts: 4
Topic starter
(@sandeep-akula)
Active Member
Joined: 9 months ago

I have a Fusion Projects Rest API which can fetch at a maximum of 500 projects at a time. I am trying to pull all the projects from this API using Limit, offset Parameters and hasMore attribute. In OIC i can do it using a While Loop which is a standard option but i dont see the same option available in VBCS. I can keep looping until hasmore attribute is false.

My goal to pull all projects in VBCS Action chain and assign it to a variable which can be use in various apps in VBCS. Issue is that i dont see an option for while loop in VBCS. How is it possible to fetch all rest API data into a Array using the limit, offset and hasmore.

Thanks in advance for your feedback.

 

Thanks

Sandeep

 

2 Replies
Posts: 346
(@training-operations)
Reputable Member
Joined: 3 years ago

Hi Sandeep, 
If you want to loop it through until has More is false, you can do it in the action chain using for loop but for this you need and temporary array (array that has similar structure of response body of the API) that holds a data until the entire loop completes. After that you can add it to the ADP. which is a long process in case of more data. This will affect application performance. Instead of using ADP, you can use SDP as a data source. If you are using SDP then the component will automatically fetch data according to your filter parameter. Fetching all the data to client side is not a good option.


Thanks & Regards

Apps2fusion Team

Posts: 346
(@training-operations)
Reputable Member
Joined: 3 years ago

Hello,

Hope you are doing great!

We hope we were able to help you out with this query and all your questions were cleared, If you have anything to add on, Our team will surely help you out with it. 

For now, with your consent, we can close this query.

Thanks & Regards

Share: