Skip to main content

Notifications

PowerApps: Gallery / SubGallery using GroupBy and Flexible Height

PaulD1 Profile Picture Posted by PaulD1 2,914

Nesting a gallery with another gallery to show related data - e.g. an Order Header with multiple rows of Order Details beneath.
A key concept is the use of the GroupBy function to 'shape' your data and controlling the height of flexible height galleries so your detail rows are always visible.

Categories:

Comments

  • PowerApps: Gallery / SubGallery using GroupBy and Flexible Height

    @Johnh1 wrote:

    Hello Paul,

     

    Great video.  Very well done and easy to follow.  I have created a Gallery inside a Gallery and it is working.  The parent gallery is grouped by DateText (Date field doesn't work) and then the child gallery list all of the associated children for the DateText value.  The one issue I have to to be able to sort and filter the galleries.  I have tried a number of different ways of working it but can't seem to get it to work.  I would like the order of the gallery to be by DateText and to filter on Location, which is a drop down selection box.  Any suggestions?

     

    Regards,

    John


    Hi John,

     

    I think it would be a Filter() for the datasource inside of the GroupBy() function.  I like to say it to myself as a Filter() before a GroupBy() since the formulas end up working from the inside out.  Not sure my syntax is 100% perfect, but hopefully this communicates the idea:

    GroupBy(Filter(YourDataSource,LocationDropdown.Selected.Location = LocationField),"DateText","Rest of the Data")

     

    By the way, this would filter the data for all nested galleries.

  • Johnh1 Profile Picture Johnh1 20
    Posted at
    PowerApps: Gallery / SubGallery using GroupBy and Flexible Height

    Hello Paul,

     

    Great video.  Very well done and easy to follow.  I have created a Gallery inside a Gallery and it is working.  The parent gallery is grouped by DateText (Date field doesn't work) and then the child gallery list all of the associated children for the DateText value.  The one issue I have to to be able to sort and filter the galleries.  I have tried a number of different ways of working it but can't seem to get it to work.  I would like the order of the gallery to be by DateText and to filter on Location, which is a drop down selection box.  Any suggestions?

     

    Regards,

    John

  • JOBAK93 Profile Picture JOBAK93
    Posted at
    PowerApps: Gallery / SubGallery using GroupBy and Flexible Height

    Hi, 

     

    I have a SharePoint list with different clothes ( Manager Polo, Driver Polo) and in different sizes (s, m, L...) and I build Groupby Gallery and a sub Gallery as you describes. But is it although possible to create the sub gallery on the next page

    It would be amazing if you can help me. 

     

    Best regards 

  • satya Profile Picture satya 40
    Posted at
    PowerApps: Gallery / SubGallery using GroupBy and Flexible Height

    Hi Paul,

     

    i have see the 

    PowerApps: Nested Galleries and Overcoming the 500 record limit

    it helped me a lot. i am using sharepoint list in my nested galleries. i cannot use ID, because if we delete any record the id value wont change. could you please help me how to achive this.

  • PaulD1 Profile Picture PaulD1 2,914
    Posted at
    PowerApps: Gallery / SubGallery using GroupBy and Flexible Height

    Hi @satya

    Because Auditor is a complex field (has numerous 'properties', such as displayname and email) there is an extra trick involved.

     

    You need to use the AddColumns command to pick out the specific property from the complex "Auditor" field that you want to use in your GroupBy command.

     

    Step 1 is to find out the internal column name for your "Auditor" column. To do this, add a Datatable to your PowerApp, choose your SharePoint list as the Items property and then tick the "Auditor" Column and expand it as shown below:

    ComplexField.png

     You can now see the field name (which differs from the Field display name "Auditor") - in my case it was ljpv.

     

    Step 2: Now you can use the AddColumns command to add a specific property from "Auditor" to your data. In this case, I have added a column called MyDisplayName and based it on the DisplayName property of the "Auditor" column. Finally, I can wrap that in a normal GroupBy command specifying "MyDisplayName" as the column for the grouping:

     

    GroupBy(AddColumns(DemoSalesData,"MyDisplayName",ljpv.DisplayName),"MyDisplayName","MyGroupName")

    I will say this is far from obvious. There may be a better technique but this is what I just found while trying work out how to do this and it seems to work.

     

    Cheers

    Paul

  • satya Profile Picture satya 40
    Posted at
    PowerApps: Gallery / SubGallery using GroupBy and Flexible Height

    Hi Paul,

     

    i have Auditor field name in sharepoint list, it is a people or group type columns in sharepoint. i would like to group by with Auditor but i am getting error as Auditor doesnot exist

    GroupBy("listName","Auditor","mygroupname")

  • satya Profile Picture satya 40
    Posted at
    PowerApps: Gallery / SubGallery using GroupBy and Flexible Height

    Hi Paul,

     

    i have Auditor field name in sharepoint list, it is a people or group type columns in sharepoint. i would like to group by with Auditor but i am getting error as Auditor doesnot exist

    GroupBy("listName","Auditor","mygroupname")

  • PowerApps: Gallery / SubGallery using GroupBy and Flexible Height

    @Yaonline were you able to get a working solution?  I have a similar issue.

     

    I have attached 3 photos.

     

    Item1_nested_Working.png shows how I'd like the rest of the rows to behave.

     

    Item4_nested_Stacked.png shows the issue.

     

    These are 2 nested flexible height galleries.  The 12 point star is intended to cause the flexible height gallery to expand and contract.  It's frustrating because I can see it working as intended in the first row.  These seems to happen on my iPhone as well as chrome editor in preview mode.

     

    @PaulD1 I really appreciate your work.  Your videos are very helpful!

  • PaulD1 Profile Picture PaulD1 2,914
    Posted at
    PowerApps: Gallery / SubGallery using GroupBy and Flexible Height

    Hi @TV2

     

    Sorry, not sure what you mean by doing a GroupBy on a LookUp column - are you looking for cascading drop downs (select item in drop down 1 and only related items are shown in drop down 2)?

     

    If you just want to use it to remove duplications (so each entry only appears once in the dropdown) you can use the Distinct function.

     

    Cheers

    Paul

  • TV2 Profile Picture TV2
    Posted at
    PowerApps: Gallery / SubGallery using GroupBy and Flexible Height

    Hi,

     

    Thank you for sharing this video.

     

    I have a question, i would like to do the same example, but to GroupBy on a lookup column.

     

    Do you know if is it possible ?

     

    Thank you.