cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rsanya
Helper II
Helper II

Incorrect display in gallery using GroupBy

Hi,

I am trying to display the output GroupBy formula and it doesn't display as expected.

 

My gallery Items property has "GroupBy(SortByColumns(Filter('[dbo].[vw_RosterDetails]', StartDate<=rosterDatePicker.SelectedDate && EndDate>=rosterDatePicker.SelectedDate),"StartTime",Ascending), "Name","StartTime","EndTime","Processes")"

Processes Column contains a  table which has 1 or more processes attached to each name. e.g.
Name - ABC
Processes table - CSS
Name - DEF
Processes table - CSS  in 1 row and FLR in the 2nd row.

 

And it displays all the processNames from 'Processes' grouped together.

I am displaying the processName using "Concat(ThisItem.Processes,ProcessName, " , ")".

 

Current Output:

CSS ,  CSS,  FLR

 

Expected Output:
ABC
StartTime - EndTime   CSS
DEF

StartTime - EndTime   CSS , FLR

Attached are the screenshots.

 

Thanks in advance.

5 REPLIES 5
WarrenBelz
Super User III
Super User III

Hi @rsanya ,

Firstly, I would replace the Name column with another title as Name is a Reserved Word in Power Apps and can cause formula ambiguity. Secondly, try this for a start.

SortByColumns(
   GroupBy(
      Filter(
         '[dbo].[vw_RosterDetails]',
         StartDate<=rosterDatePicker.SelectedDate && 
         EndDate>=rosterDatePicker.SelectedDate
      ),
      "Name",
      "StartTime",
      "EndTime",
      "Processes"
   ),
   "StartTime",
   Ascending
)

 

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.

Thanks @WarrenBelz.

 

I replaced the property as mentioned and it still displays all the processes together. I think there is some issue with this formula "Concat(ThisItem.Processes, ProcessName, " , ")".

 

v-siky-msft
Community Support
Community Support

Hi @rsanya ,

 

That's weird as your code work perfectly on my side. 

Could you try to save the GourpBy output into a Collection, and then Go to File-Collection to see if the nested Processes table is as you expected? Also Please share Collection Snapshots with us!

 

Another confusion! What is the Items property formula of the gallery? The GroupBy output shows two record, but there is only one record shown in the gallery. I believe this is where the issue is. Please elaborate it.

 

Sik

Ok @rsanya ,

I need to delve another level on this as I initially only mentioned a couple of things I could see may need fixing.

I saw the Concat() reference, but as the field name was not mentioned in your formula, did not see the relevance. So going back the the core of your formula (forget about the filter and sort for the moment)

GroupBy(
   '[dbo].[vw_RosterDetails]',
   "Name",
   "StartTime",
   "EndTime",
   "Processes"
)

you will get a result with four column - single data all relevant combinations of Name, StartTime and EndTime and a table with the rest of the field in the list and all the records belonging to each group. As these can be multiple, how were you intending to display your field?

 

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.

 

Hey @WarrenBelz 

After GroupBy I get 4 Columns with distinct names and the Processes Column contains the table with processNames corresponding to each name.
ProcessNames may be single or multiple row.

Currently what i need to do is concat all processNames corresponding to the each Name.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (17,560)