cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

GroupBy Filter not always showing all items from collection

I have a Power App in development where I have a couple of Dropdowns that get data from a SharePoint list.
When selecting some of the "Function" items, I get all Process assoicated with that Function.
But for a couple of the Functions I only get the first Process.

Information... 
calfunctionvalue is a calcualted (Single Text field) of the Function (Choice Field)
ndworkplan is the sharepoint list

Here are the formulas I have in the App:

Screen - OnVisible:
Collect(WorkPlanFunc,ndworkplan)

1st dropdown(Function):
Dropdown_Function Formula:
GroupBy(WorkPlanFunc.calfunctionvalue,"calfunctionvalue","itemsbycalfunctionvalue")

2nd Dropdown(Process):
Dropdown_Process Formula:
Distinct(Filter(WorkPlanFunc,calfunctionvalue=Dropdown_Function.Selected.calfunctionvalue),Process)

When selecting "Product Development" as the Function, I see all Process items assigned to that function:

proddevprocess.png

When selecting "Employee Experience" I only get the first Process:

employeeexpprocess.png

As you can see below, from the SharePoint list other processes are assigned to that function:

employefunctionSp.png

As I said, this issue only shows for 2 of the 22 Functions.. 

Not sure if there is a limit, even when using a Collection but..

The Product Development Function has 182 Items associated with it, Employee Expereince has 196.

2 ACCEPTED SOLUTIONS

Accepted Solutions

@Anonymous 

Okay, now we're down to business...

First, make sure you're at least at the 2000 record limit - which you have checked.

 

Next, Set the Items property of your DropDown list to the following:  (I will refer to the Function dropdown as ddFunction and the Process dropdown as ddProcess - change accordingly in your app)

   

GroupBy(
   GroupBy(
        AddColumns(ndworkplan, "txtFunction", Function.Value), 
       "txtFunction", 
       "Process", 
       "processItems"
      ),
   "txtFunction", 
   "functionItems"
)

Make sure the DropDown value is set to txtFunction  At this point, the dropdown should show you all the distinct function names.

Now, set the Items property of the second (Process) DropDown to:

   ddFunction.Selected.functionItems 

and make sure your second dropdown box value is set to Process

 

Now, you can set your Gallery items to ddProcess.Selected.processItems

and you will have all the cascading from the first dropdown through to the Gallery.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

@Anonymous 

Ah, gotcha...okay.  Looking at the data again, we can actually encapsulate everything into the one DropDown. With this on the Items property (and note I've changed some names to better reflect the grouping):

 

GroupBy(
GroupBy( GroupBy( AddColumns(ndworkplan, "txtFunction", Function.Value), "txtFunction", "Process",
"Milestone ID",
"Tasks"),
"txtFunction",
"Process", "Milestones"), "txtFunction", "Processes" )

Now, for the Process DropDown Items:  ddFunction.Selected.Processes Display value set to Process

Your Left Gallery (I'll call it galMilestones) set the Items property to : ddProcess.Selected.Milestones

In your template for your Label, set the text property to CountRows(ThisItem.Tasks)

And...as as bonus that we haven't gotten to yet...I believe you want to show the tasks in the right gallery (I'll call it galTasks) set the galTasks items property to galMilestones.Selected.Tasks 

 

That should group it all up and cover all the levels.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

17 REPLIES 17
yashag2255
Super User
Super User

Hi @Anonymous 

 

Can you please confirm the number of items in your SharePoint list? I am guessing that this is greater than 500 and due to delegation your app is ot able to read more than 500 records. If your number of items is less than 2000. Can you try to update a setting:
 
App Settings -> Advanced Settings -> Data Row Limit for non-delegable queries -> Set this value to 2000
 
This will fetch 2000 records from SharePoint at a single time.
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
RandyHayes
Super User
Super User

@Anonymous 

If I understand your goal here, you want the first DropDown to be a list of distinct functions and the second DropDOwn list to be the filtered (by the first DropDown) list of Process from your SharePoint List.

 

I'm not sure why you have a need for a calculated column for the Function column. You might be able to simplify and remove that if not needed.

 

However, If the above is the case, then consider changing the formulas to the following:

Screen

   OnVisible - remove the formula from there - not needed

1st DropDown

   Items Property:  GroupBy(ndworkplan, "calfunctionvalue", "itemsbycalfunctionvalue")

2nd DropDown

   Items Property:  DropDown1.Selected.itemsbycalfunctionvalue

 

Replace DropDown1 with the name of your 1st DropDown control.

 

This should give you what you are looking for.

 

I hope this is helpful for you.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
Anonymous
Not applicable

@yashag2255  Thanks for the reply.. I had checked this previously.. The Total number of items is a little over 1500 and I've set the Data row limit to 2000 with no change.

As I said, it is strange that this is only affecting two of the 22 Functions. 

Anonymous
Not applicable

@RandyHayes   Thanks for the reply..

I created the Calculated column as I was intially having some issues with the first dropdown and read about issues using a Choice Field so figured "better safe then sorry" by eliminating that potential issue.

 

I did the OnVisible Collection as I was wondering if the list size of 1500+ Items was causing an issue. So figured I'd create a colelction of the data to work with. Either way, uisng the Collect, or not, gave the same results.

 

I did set the first dropdown back to using the orginal formula I had, which you listed :GroupBy(ndworkplan, "calfunctionvalue", "itemsbycalfunctionvalue")

 

But using your formula for the 2nd dropdown( Dropdown_Function.Selected.itemsbycalfunctionvalue) gives no results in the 2nd dropdown.

@Anonymous 

So, check your record limits as well as @yashag2255 mentioned if you have a list that is that size.  You can set it to a max of 2000 items.  If your list is les than 2000, this should resolve any of those issues and you should see values in your dropdowns.

Also, you probably already did, but check that you have the proper column showing in your second dropdown.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
Anonymous
Not applicable

@RandyHayes 

Thanks.. I've triple checked the Data row limit ( set at 2,000 and have 1,500 items) and the Column for the 2nd dropdown is correct..
using this formula: 
Distinct(Filter(WorkPlanFunc,calfunctionvalue=Dropdown_Function.Selected.calfunctionvalue),Process)
does bring back the processes for 20 of the 22 funtions correctly.
Only 2 functions fail to return all processes.

BTW.. the reason I started using the collect for "OnVisible" is that if I try to set the dropdown to "ndworkplan" rather then my collection, I get this warning:

Delegation warning. the highlighted part of the formual might not work correctly with column "calfunctionvalue" on large data sets.

@Anonymous 

Yes, the delgation warning will be there because you are using a non delgable function.  However, this is only a warning and if you know that your record limit is high enough to account for the total list size, then you can just ignore it.

 

The original formula I gave you should be working perfectly.  If it is not, then I would go back to that level and see what is going on.  In particular, there is some issue with the GroupBy that is not grouping the way that you expect.

 

I don't know if you have additional columns in your list or if your Process column has duplicate values (as I see you are using distinct).  If that is the case, then I could see where issues might come in.  

But, if your list is only Function and Process columns and they are both Text columns, then you should have no issue.

 

I am somewhat focused on the fact that you put a "Distinct" function in there and got values.  This makes me zero in on the Value property of the DropDown control, as it means you are changing it, or it changed to "Result" rather than "Value" or, in your case "Process".

 

So, if the original formula is not working, then again, I'd try to resolve why that is not, because it should (and does) work just fine.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
Anonymous
Not applicable

@RandyHayes   This list has many columns and multiple entries for each Function and processes. Maybe a quick reasoning might help 😉

I took this over from someone that left and I'm trying to make it easier for users to work with existing data and update as needed.

Here is an example of what the fuction "Product Development" looks like in the SP list:

listview.png

As you can see, quite a mess.
So, my idea was to present them a PowerApp view that "filters" data by first the Function, then the Process.
The reason for the 2nd "Filter" is that, in the case of Product Development Fuction, there are 182 items.
So, what I hoped to do is use the 2nd dropdown to filter down to the process of the function. Then in the gallery show just those processes. The user could click a "Milestone" and see the task assoicaiated with it in the 2nd gallery, and then a 3rd gallery to view the task information..
Here is what I have so far which shows the Milestone and how many tasks are associated to it( just a blank 2nd gallery right now):

appidea.png
While fighting the 2nd dropdown battle, I've also been trying to figure out how to get the 1st Gallery to display the items by the Process Dropdown.
As seen above, currently the Formula for my gallery is for the 1st dropdown(Fuction)... so I also need to figure out how to use the "Process" dropdown for that gallery.

While I fight the 2nd dropdown battle, maybe you can also help with the Gallery formula??

The current gallery formula is:
GroupBy(Filter(WorkPlanFunc,Dropdown_Function.Selected.calfunctionvalue = calfunctionvalue),"Milestone_x0020_Name","ItemsByMileStoneName") which works, but not what I want..

I'd like to change the gallery to view items based on the 2nd dropdown "DropDown_Process".. but just changing the name in the formula isn't working.

I am "way" over my head on this as up till now my PowerApp creations have mainly been Customized form and I've not had any "official" PowerApps training.. yet... 

@Anonymous 

Ah yes...the clearer picture is worth a thousand words!

Let me ask this before I give a formula that may not work... What kind of columns are Function, Process and Subprocess?  Are they Text columns or Choice columns?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements

Tuesday Tip | How to Get Community Support

It's time for another Tuesday Tip, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.       This Week: All About Community Support Whether you're a seasoned community veteran or just getting started, you may need a bit of help from time to time! If you need to share feedback with the Community Engagement team about the community or are looking for ways we can assist you with user groups, events, or something else, Community Support is the place to start.   Community Support is part of every one of our communities, accessible to all our community members.   Within each community's Community Support page, you'll find three distinct areas, each with a different focus to help you when you need support from us most. Power Apps: https://powerusers.microsoft.com/t5/Community-Support/ct-p/pa_community_support Power Automate: https://powerusers.microsoft.com/t5/Community-Support/ct-p/mpa_community_support Power Pages: https://powerusers.microsoft.com/t5/Community-Support/ct-p/mpp_community_support Copilot Studio: https://powerusers.microsoft.com/t5/Community-Support/ct-p/pva_community-support   Community Support Form If you need more assistance, you can reach out to the Community Team via the Community support form. Choose the type of support you require and fill in the form accordingly. We will respond to you promptly.    Thank you for being an active part of our community. Your contributions make a difference!   Best Regards, The Community Management Team

Community Roundup: A Look Back at Our Last 10 Tuesday Tips

As we continue to grow and learn together, it's important to reflect on the valuable insights we've shared. For today's #TuesdayTip, we're excited to take a moment to look back at the last 10 tips we've shared in case you missed any or want to revisit them. Thanks for your incredible support for this series--we're so glad it was able to help so many of you navigate your community experience!   Getting Started in the Community An overview of everything you need to know about navigating the community on one page!  Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Community Ranks and YOU Have you ever wondered how your fellow community members ascend the ranks within our community? We explain everything about ranks and how to achieve points so you can climb up in the rankings! Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Powering Up Your Community Profile Your Community User Profile is how the Community knows you--so it's essential that it works the way you need it to! From changing your username to updating contact information, this Knowledge Base Article is your best resource for powering up your profile. Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Community Blogs--A Great Place to Start There's so much you'll discover in the Community Blogs, and we hope you'll check them out today!  Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Unlocking Community Achievements and Earning Badges Across the Communities, you'll see badges on users profile that recognize and reward their engagement and contributions. Check out some details on Community badges--and find out more in the detailed link at the end of the article! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Blogging in the Community Interested in blogging? Everything you need to know on writing blogs in our four communities! Get started blogging across the Power Platform communities today! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Subscriptions & Notifications We don't want you to miss a thing in the community! Read all about how to subscribe to sections of our forums and how to setup your notifications! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Getting Started with Private Messages & Macros Do you want to enhance your communication in the Community and streamline your interactions? One of the best ways to do this is to ensure you are using Private Messaging--and the ever-handy macros that are available to you as a Community member! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Community User Groups Learn everything about being part of, starting, or leading a User Group in the Power Platform Community. Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Update Your Community Profile Today! Keep your community profile up to date which is essential for staying connected and engaged with the community. Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Thank you for being an integral part of our journey.   Here's to many more Tuesday Tips as we pave the way for a brighter, more connected future! As always, watch the News & Announcements for the next set of tips, coming soon!

Hear what's next for the Power Up Program

Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram, including a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the link below to sign up today! https://aka.ms/PowerUp  

Tuesday Tip: Community User Groups

It's time for another TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   As our community family expands each week, we revisit our essential tools, tips, and tricks to ensure you’re well-versed in the community’s pulse. Keep an eye on the News & Announcements for your weekly Tuesday Tips—you never know what you may learn!   Today's Tip: Community User Groups and YOU Being part of, starting, or leading a User Group can have many great benefits for our community members who want to learn, share, and connect with others who are interested in the Microsoft Power Platform and the low-code revolution.   When you are part of a User Group, you discover amazing connections, learn incredible things, and build your skills. Some User Groups work in the virtual space, but many meet in physical locations, meaning you have several options when it comes to building community with people who are learning and growing together!   Some of the benefits of our Community User Groups are: Network with like-minded peers and product experts, and get in front of potential employers and clients.Learn from industry experts and influencers and make your own solutions more successful.Access exclusive community space, resources, tools, and support from Microsoft.Collaborate on projects, share best practices, and empower each other. These are just a few of the reasons why our community members love their User Groups. Don't wait. Get involved with (or maybe even start) a User Group today--just follow the tips below to get started.For current or new User Group leaders, all the information you need is here: User Group Leader Get Started GuideOnce you've kicked off your User Group, find the resources you need:  Community User Group ExperienceHave questions about our Community User Groups? Let us know! We are here to help you!

Super User of the Month | Ahmed Salih

We're thrilled to announce that Ahmed Salih is our Super User of the Month for April 2024. Ahmed has been one of our most active Super Users this year--in fact, he kicked off the year in our Community with this great video reminder of why being a Super User has been so important to him!   Ahmed is the Senior Power Platform Architect at Saint Jude's Children's Research Hospital in Memphis. He's been a Super User for two seasons and is also a Microsoft MVP! He's celebrating his 3rd year being active in the Community--and he's received more than 500 kudos while authoring nearly 300 solutions. Ahmed's contributions to the Super User in Training program has been invaluable, with his most recent session with SUIT highlighting an incredible amount of best practices and tips that have helped him achieve his success.   Ahmed's infectious enthusiasm and boundless energy are a key reason why so many Community members appreciate how he brings his personality--and expertise--to every interaction. With all the solutions he provides, his willingness to help the Community learn more about Power Platform, and his sheer joy in life, we are pleased to celebrate Ahmed and all his contributions! You can find him in the Community and on LinkedIn. Congratulations, Ahmed--thank you for being a SUPER user!  

Tuesday Tip: Getting Started with Private Messages & Macros

Welcome to TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   As our community family expands each week, we revisit our essential tools, tips, and tricks to ensure you’re well-versed in the community’s pulse. Keep an eye on the News & Announcements for your weekly Tuesday Tips—you never know what you may learn!   This Week's Tip: Private Messaging & Macros in Power Apps Community   Do you want to enhance your communication in the Community and streamline your interactions? One of the best ways to do this is to ensure you are using Private Messaging--and the ever-handy macros that are available to you as a Community member!   Our Knowledge Base article about private messaging and macros is the best place to find out more. Check it out today and discover some key tips and tricks when it comes to messages and macros:   Private Messaging: Learn how to enable private messages in your community profile and ensure you’re connected with other community membersMacros Explained: Discover the convenience of macros—prewritten text snippets that save time when posting in forums or sending private messagesCreating Macros: Follow simple steps to create your own macros for efficient communication within the Power Apps CommunityUsage Guide: Understand how to apply macros in posts and private messages, enhancing your interaction with the Community For detailed instructions and more information, visit the full page in your community today:Power Apps: Enabling Private Messaging & How to Use Macros (Power Apps)Power Automate: Enabling Private Messaging & How to Use Macros (Power Automate)  Copilot Studio: Enabling Private Messaging &How to Use Macros (Copilot Studio) Power Pages: Enabling Private Messaging & How to Use Macros (Power Pages)

Top Solution Authors
Top Kudoed Authors
Users online (3,748)