Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Help needed with AddColumns and GroupBy Gallery

Posted on by 353

@WarrenBelz 

Am trying to present a Gallery of data grouped by a field called meterno. I can get the Gallery to display and it is grouped by that field correctly but I need additional fields like eventID added so I am trying to use AddColumns

 

My code for the Items property of the Gallery is not showing any errors but when I try to display the eventID field, for example, it is telling me it is a Record (the Text property for the label in the Gallery is ThisItem.theeventid)

 

the Items property of the Gallery is:

 

AddColumns(
 GroupBy(
 With(
 {
 _preFilter: Filter(
 Claims,
 startdatetime >= (DatePickerFrom_2.SelectedDate) && (enddatetime <= DatePickerTo_2.SelectedDate)
 )
 },
 If(
 !IsBlank(Searchbox_1.Selected.eventID),
 Filter(
 _preFilter,
 (eventID in Searchbox_1.SelectedItems.eventID)
 ),
 _preFilter
 )
 ),
 "meterno",
 "licensee",
 "Title",
 "Data"
),"theeventid",Data.eventID)

 

it's probably something simple but I can't seem to work it out

any help much appreciated as always 🙂

Categories:
  • bobgodin Profile Picture
    bobgodin 353 on at
    Re: Help needed with AddColumns and GroupBy Gallery

    @WarrenBelz thanks Warren - much appreciated

  • Verified answer
    WarrenBelz Profile Picture
    WarrenBelz 143,246 on at
    Re: Help needed with AddColumns and GroupBy Gallery

    Hi @bobgodin ,

    I have made a few other suggestions as well as fixing the eventID issue<

    With(
     {
     _preFilter: 
     Filter(
     Claims,
     startdatetime >= DatePickerFrom_2.SelectedDate && 
     enddatetime <= DatePickerTo_2.SelectedDate
     )
     },
     AddColumns(
     GroupBy(
     Filter(
     _preFilter,
     Len(Searchbox_1.Selected.eventID) = 0 ||
     eventID in Searchbox_1.SelectedItems.eventID
     )
     ),
     "meterno",
     "licensee",
     "Title",
     "Data"
     ),
     "theeventid",
     First(Data).eventID
    )

     

    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

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,246

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,884

Leaderboard