Hello all, I've searched around and tried several methods to make this work, but so far no luck. I'm hoping someone with more experience can shed some light.
I am writing a simple app that will allow group leaders to define a couple of data points about their direct reports. The app's OnStart begins by writing the contents of Office365Users DirectReportsV2 to a collection (since I do not have any direct reports, I am testing with another user's account, but this code will ultimately reflect the user launching the app):
ClearCollect(
colMyDirectReports,
Office365Users.DirectReportsV2("user@company.com").value
);
They are then shown a gallery that filters a SharePoint list based on who their direct reports are. The SharePoint list itself will contain all possible direct reports, but the group leader will only see their own:
Filter(SharePoint_List, Account in colMyDirectReports.userPrincipalName)
I am trying to get the app to write any of the collection's user names to the SharePoint list on start, while avoiding any duplicates. The scenario would be that Manager A has two direct reports: User B and User C. Sometime later Manager A hires User D. On first launch of the app, User D is written to the SharePoint list so that they are visible in the app, but Users B and C are not written to the list a 2nd time.
So far I have managed to either A) write the direct reports to the list on every launch, resulting in many duplicates, or B) write only the first direct report in the collection to the list while avoiding duplicates.
I'm happy to provide any additional info that could help. Many thanks in advance for any assistance!