cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Cooper01
Continued Contributor
Continued Contributor

Delegation workaround for Distinct()?

I have a canvas app where data source is Dataverse. Screen in app shows gallery connected to a list containing Products. Each product has a category field and an item description field. On this screen, I want the gallery to show a distinct list of categories and then we'll click into the category to see its items.

 

The actual categories displayed have some additional conditional logic based on the products themselves (such as quantity in stock), therefore I cannot point this gallery directly to the choices source for the product category.

 

I know Delegate is one of the functions that won't throw a warning but is not delegable, so 

 

Distinct(Purchases, Category)

 

won't scale. Does anyone have any other ways to get a distinct value set? Not seeing any options within the Dataverse view and with scalability being the main goal I would like to avoid caching data onstart.

1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User
Dual Super User

The only option I can suggest is to use a Power Automate recurrence flow to sync a copy of the distinct values to another table in Dataverse.  Then use that table for your gallery.  Power Automate doesn't have the same limitations on delegation that Power Apps does.  The only other way to do this is to use a delegable function to sync a copy of the full table to a local collection and then do Distinct on that.  But the performance on that will be poor.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

View solution in original post

2 REPLIES 2
Pstork1
Dual Super User
Dual Super User

The only option I can suggest is to use a Power Automate recurrence flow to sync a copy of the distinct values to another table in Dataverse.  Then use that table for your gallery.  Power Automate doesn't have the same limitations on delegation that Power Apps does.  The only other way to do this is to use a delegable function to sync a copy of the full table to a local collection and then do Distinct on that.  But the performance on that will be poor.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

Cooper01
Continued Contributor
Continued Contributor

Thank you for the response @Pstork1 . Not sure yet if this is the solution I will go with but glad to know I am not missing anything simpler.

Helpful resources

Announcements
Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (1,895)