web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Return Unique Combinat...
Power Apps
Answered

Return Unique Combinations from Sharepoint

(0) ShareShare
ReportReport
Posted on by 91

Hi all, 

I have a process that currently returns all the unique people from a person column in a sharepoint list. It then displays the data in a CSV file with name and email. 

The data set for this look like:

paulbruen1603_0-1687422456967.png

 

The end result looks like:

paulbruen1603_1-1687422486419.png

 

The code in PowerApps that builds the collection that then gets sent to a flow to turn into a CSV, looks like this:

"Export Report Owner Names/Emails",
ClearCollect(colUniqueReportOwnerEmails,
GroupBy(
Filter(
Ungroup(ERR_ComplianceData, "ReportOwner"),
ReportStatus.Value="Live" || ReportStatus.Value="Adhoc"),"DisplayName","Email","Picture", "GroupedData" ));

ForAll(colUniqueReportOwnerEmails,Collect(colUniqueReportOwnerEmails_Final,
{'Report Owner - Name': ThisRecord.DisplayName,
'Report Owner - Email': ThisRecord.Email}));

//Run flow to create the file on One Drive
Set(varExcelFileLink_ReportOwners,
ERR_ExportReportOwnersToExcel.Run(JSON(colUniqueReportOwnerEmails_Final,
JSONFormat.IgnoreBinaryData & JSONFormat.IgnoreUnsupportedTypes)).filelink);
Clear(colUniqueReportOwnerEmails);
Clear(colUniqueReportOwnerEmails_Final);
//Launch the file
Launch(varExcelFileLink_ReportOwners),

 

As you can see, this code simply looks at the ReportOwner person column and unpacks it, gets the unique value and then send the collection to PowerAutomate.
What I now need to add here is the Community column, so the the end output looks like:

 

paulbruen1603_3-1687422862515.png

 

Can anyone help me with the changes required for this please?

Thanks.

 

 

 

 

Categories:
I have the same question (0)
  • paulbruen1603 Profile Picture
    91 on at

    hi - can anyone help on this please?

     

    I'm thinking perhaps with the initial collection that is created, that O create another collection and add on another column with the lookup to the Community against a ReportOwners name - just not sure how to do that though.

  • paulbruen1603 Profile Picture
    91 on at

    @WarrenBelz @RezaDorrani 

    Anyone offer any help on this please? Thanks so much...

  • WarrenBelz Profile Picture
    156,454 Most Valuable Professional on at

    Hi @paulbruen1603 ,

    Try this

    ClearCollect(
     colUniqueReportOwnerEmails,
     AddColumns(
     GroupBy(
     Filter(
     Ungroup(
     ERR_ComplianceData, 
     "ReportOwner"
     ),
     ReportStatus.Value="Live" || 
     ReportStatus.Value="Adhoc"
     ),
     "DisplayName",
     "Email",
     "Picture", 
     "GroupedData" 
     ),
     "Community",
     LookUp(
     ERR_ComplianceData,
     ReportOwner.DisplayName = DisplayName
     ).Community
     )
    );
    ForAll(
     colUniqueReportOwnerEmails,
     Collect(
     colUniqueReportOwnerEmails_Final,
     {
     'Report Owner - Name': ThisRecord.DisplayName,
     'Report Owner - Email': ThisRecord.Email,
     Community: ThisRecord.Community
     }
     )
    );

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • paulbruen1603 Profile Picture
    91 on at

    Thanks for your reply Warren. It must be really close, but I'm getting an error here in that code:

     

    paulbruen1603_0-1688543671214.png

    The error here reads: Incompatible types for comparison. These types can't be compared: Table, Text.

    The ReportOwner column is a multi-person column, albeit it only really has single values in (annoyingly). Is that the possible cause of the error?

     

    Thanks again..

    Any ideas? Nothing I seem to try is working. Even ChatGPT was unable to resolve for me.

     

     

     

     

  • Verified answer
    WarrenBelz Profile Picture
    156,454 Most Valuable Professional on at

    Hi @paulbruen1603 ,

    Your observation Even ChatGPT was unable to resolve for me might suggest a view that it has surpassed humans in Power Apps solving - believe me, it is far from that and apart from getting a bit of a checklist, currently serves more to confuse than solve. I think you need

    "Community",
    LookUp(
     ERR_ComplianceData,
     DisplayName in ReportOwner.DisplayName
    ).Community

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

     

  • paulbruen1603 Profile Picture
    91 on at

    Thanks Warren - much appreciated.

     

    Take your point on ChatGPT. For 'simple' one-liners etc it's been pretty useful. But anything as complicated even as the function above and it really does get itself twisted up.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard