Hi,

I’m relatively new to the outsystems platform and hoping to get an answer as well as a best practice recommendation.

I’m developing a traditional web application on Outsystems 11. I’m writing an application details page which is supported by 2 Rest APIs - an application details API and an application notes API. I want to call these 2 APIs on application details page load in parallel as the data points are independent. 

Here are my questions:

1. What would be the best way to make parallel API calls on page load? I can make notes part as web block if that helps.

2. While on the page, user might add another note for the application on a modal popup. If that happens, I only want to call the notes api and refresh the notes part of the page. What would be the best way to achieve that?


Thanks.

Solution

Hi Aviral,

In Web Traditional there is no parallel requesting or processing of data. Do get the data from the API's you need to do the following;

1) Create a Consuming REST endpoints  to retrieve the required data (Logic -> Integrations -> REST)

2) Add these new Actions in the Preparation Action of you screen

3) Use the results to build your screen. 


As for your other question (refreshing the data)

1) Make sure to name the container that hosts the results of your REST data

2) Make sure that the results of your REST call are placed in a local variable. 

3) After the modal is closed recall the REST and store the data in the used local variable

4) Perform an Ajax Refresh on the container that hosts the data


If you want parallel requests then you need to start using the new Web Reactive applications as these do have parallel processing of data requests (including easier refreshing). 


This course goes into detail on your topic: https://www.outsystems.com/learn/paths/2/becoming-a-traditional-web-developer/

Solution