# How to call 2 REST webservices in Activity?

**URL:** <https://forums.pega.com/t/how-to-call-2-rest-webservices-in-activity/5925>\
**Category:** General\
**Tags:** 8-8-3, pega-platform\
**Created:** [January 27, 2024, 1:24pm UTC](https://forums.pega.com/t/how-to-call-2-rest-webservices-in-activity/5925 "2024-01-27T13:24:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AbhishekC1725](https://avatars.discourse-cdn.com/v4/letter/a/9d8465/32.png) [@AbhishekC1725](https://forums.pega.com/u/AbhishekC1725)\
**Post date:** [January 27, 2024, 1:24pm UTC](https://forums.pega.com/t/how-to-call-2-rest-webservices-in-activity/5925/1 "2024-01-27T13:24:23Z")

</div>

Hi All,

One Scenario:-

We have 2 REST services which is giving data to our pega application HTTP Method = GET.

a) How we can use these 2 different REST services inside Activity?

b) We want to merge the response given by these 2 REST service and want that data to display in Grid Table layout.

Can some one please share effective way of doing this.

Thanks In Advance.

---

<div class="post-metadata">

**Author:** ![Anoop\_Krishna](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/anoop_krishna/32/23458_2.png) [@Anoop\_Krishna](https://forums.pega.com/u/Anoop_Krishna)\
**Post date:** [January 27, 2024, 2:38pm UTC](https://forums.pega.com/t/how-to-call-2-rest-webservices-in-activity/5925/2 "2024-01-27T14:38:04Z")

</div>

@AbhishekC1725 you can use Load-datapage and connect-wait in activity and in dpage, configure it as aggregated sources. In the below link you can see it is sourced with 2 RDs as it is different tables scenario. As yours is 2 different connect rest, you can give 2 connect rest as the sources.

[https://onestoppega.com/data-modeling/aggregate-source-in-data-page/](https://onestoppega.com/data-modeling/aggregate-source-in-data-page/)

---

<div class="post-metadata">

**Author:** ![AbhishekC1725](https://avatars.discourse-cdn.com/v4/letter/a/9d8465/32.png) [@AbhishekC1725](https://forums.pega.com/u/AbhishekC1725)\
**Post date:** [January 27, 2024, 3:06pm UTC](https://forums.pega.com/t/how-to-call-2-rest-webservices-in-activity/5925/3 "2024-01-27T15:06:27Z")

</div>

@Anoop Krishna Thanks Anoop for response 😊.

Just one thing want to confirm Suppose if response get delayed out of these 2 REST service due to any reason. So how we will handle this thing?

---

<div class="post-metadata">

**Author:** ![Anoop\_Krishna](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/anoop_krishna/32/23458_2.png) [@Anoop\_Krishna](https://forums.pega.com/u/Anoop_Krishna)\
**Post date:** [January 27, 2024, 3:45pm UTC](https://forums.pega.com/t/how-to-call-2-rest-webservices-in-activity/5925/4 "2024-01-27T15:45:32Z")

</div>

@AbhishekC1725 if response is delayed because of some reason we can know that with the api response and we can set a flag, for eg:- api2results=false(meaning api 2 didn’t give results). In the flow where we call this utility activity, we can use a decision shape checking both the flags. If any of the flag is false we can queue this utility activity to a dedicated queue processor with delayed 30 mins or 1 hours so that api will be hit again.

Also in the data page, here it should be 2 activities instead of 2 connect rests and in the activity we can use the flag as first check to hit api. If flag false hit api else exit activity.

---

<div class="post-metadata">

**Author:** ![AbhishekC1725](https://avatars.discourse-cdn.com/v4/letter/a/9d8465/32.png) [@AbhishekC1725](https://forums.pega.com/u/AbhishekC1725)\
**Post date:** [January 27, 2024, 4:11pm UTC](https://forums.pega.com/t/how-to-call-2-rest-webservices-in-activity/5925/5 "2024-01-27T16:11:52Z")

</div>

@Anoop Krishna Thanks for Response 😊
