Hello,
From your entites I’m not getting exact associations but depending on my understanding I’m giving answer considering below associations.
Entities(UserData,Task)
Associations
1)UserData_TeamLead(*...1 many user can have 1 team lead)
2)UserData_Task(1...* 1 user can have many tasks)
A)Now you want to retrieve Task objs of employees who are reporting to all Team lead(for all users except team lead) and
retrieve Task objs of employees who are reporting to logged Team lead(if team lead logged in)
-for datagrid select datasource as microflow
-in that microflow first retrive current logged in user
-check logged in user, if logged in user not team lead then
-----retrieve task objs from database with xpath Task_UserData/UserData/UserData_TeamLead!=empty
-----and return that retrieved taskList
-if logged in user team lead then
-----retrieve task objs from database with xpath Task_UserData/UserData/UserData_TeamLead!=$CurrentUser
-----and return that retrieved taskList
Kindly adjust logic as required.
Hope this helps you.
Thank you.