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

How to Modify a Data source into custom column gallery

 

Hi Community,

I have a requirement. I am trying to figure out using groupby , addcolumns but unable to achieve what i need.

I have a table like below with user and candy. I want to create a new gallery where the users information is stored along with the no of candy allowed. (So if for example Antony occurs more than 3 times , then the Maximum column should be 3, if its less than 3 , then no issue)

 

Datasource/Table

PowerO365Guy_0-1618957331674.png

 

Expected table into a Gallery

PowerO365Guy_1-1618957479925.png

 

 

3 REPLIES 3
RandyHayes
Super User
Super User

@Anonymous 

Set the Items property of your Gallery to:

   AddColumns(GroupBy(yourDataSource, "User", "_recs"), "_maximum", CountRows(_recs))

 

Set a label in the Gallery to ThisItem.User  and another to ThisItem._maximum

 

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

@RandyHayes,

Thanks for helping.

Actually using that query gives me the sum however what i am looking for is a if condition. if the users (e.g Antony) has the candy count of more than 3 times then the Table/Gallery should have Antony in Users and 3 in Maximum. 

if the count is less than 3, then we leave the count as it is.

RandyHayes
Super User
Super User

@Anonymous 

I'm not exactly understanding that logic.  If the candy count is a count of the records for that user, are you saying if it is more than 3 that it should just show 3, and if less than 3, should be the count?

_____________________________________________________________________________________
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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Check out the New Ideas Site

We are excited to announce a new way to share your ideas for Power Apps!

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