Hi,
I'm building an application to add employee activities to our ERP, and then assign attendees to those activities.
First I have to make a call to our ERP to add an activity, which then returns the Activity ID from ERP. Then using that, I'm supposed to add all of the attendees to the activity.
Theres multiple activities that can have multiple attendees.
During the process, I'm saving all of the Activities to a table in my database, and Attendees to another table (and they're connected by activity_id field in Attendees table.
Then I make a call to get AllActivities into a collection to loop through.
This is what I currently have:
ForAll(
AllActivities;
Collect(
AddedActivity;
'My API'.AddActivitiesToBusinessPartner(
{
/* API CALL HERE */
}
)
)
)
My database schema is as follows, and below is the collection that gets created:



What I can't figure out is: how would I go about nesting another ForAll loop in there, that would make the other API call to add attendees to the activity?
So basically:
- add activity
- get ID from the ERP
- loop trough database and see if there's attendees
- add attendees to ERP