I have a problem understanding how the ForAll() works internally, based on the documentation it will execute all the formulas at once, but based on my test it will do this based on a sequence one by one. for example i have this formula which do these steps:-
ClearCollect(colTeamSitesItem,Filter('Team Sites',1=1));
ClearCollect(colAllGroups,Office365Groups.ListGroups().value);
ForAll(colAllGroups As group,
ForAll(colTeamSitesItem As i2,
If(Lower(group.displayName)=Lower(i2.'Team Site Name'),
Collect(colRelatedGroupsIds,group.id))));
ForAll(colRelatedGroupsIds As group,
Collect(colRelatedPlanners,
Planner.ListGroupPlans(group.Value).value);
ForAll(colRelatedPlanners As planner,
Collect(colRelatedPlannerTasks,
Planner.ListTasksV3(planner.id,group.Value).value);
ForAll(colRelatedPlannerTasks As task,
ForAll(task._assignments As taskAssignment,
Patch(finalResult,Defaults(finalResult),
{
PlanTitle:planner.title,
AssignedToUserId:taskAssignment.userId,
Status:task.percentComplete,
TaskTitle:task.title,
DueDate:task.dueDateTime
})
));
RemoveIf(colRelatedPlannerTasks,true));
RemoveIf(colRelatedPlanners,true));
1) Get the Office 365 groups from a sharepoint list
2) Get All the Office 365 groups from AD
3) check if the AD group is define inside the sharepoint group and build the colRelatedGroupsIds
4) iterate over the colRelatedGroupsIds >> and for each group get the group plans + iterate over the Plan Tasks
5) after iterating over each plan + each group i Clear the related collection, to avoid duplicate and wrong Plan Tasks.
now my above code is working well.. but it could not work well, unless the ForAll() execute the formulas in a sequence and not all at once.. but based on my reading is that ForAll() does not execute the formulas in a sequence but rather all at once.. so can anyone advice how ForAll() works internally?
Thanks