web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :

PowerApps Sub Galleries: Expanding and Collapsing

PaulD1 Profile Picture Posted by PaulD1 2,914

How to expand and collapse a nested gallery / sub-gallery. Following on from my video on creating nested galleries here is a demo of how you can set your sub-galleries to expand or collapse when you click on the parent gallery. Two methods are shown, one allowing you to expand a single sub-gallery at a time and one allowing you to expand/collapse whichever sub-galleries you choose.
The second option makes use of a collection and the functions Collect, Remove, CountRows and IF.

Categories:

Comments

  • Lionel Profile Picture Lionel 5
    Posted at
    PowerApps Sub Galleries: Expanding and Collapsing

    Thank you @PaulD1. I was able to workaround the dev issue. Major bug was in production: list is misdisplayed after the first screen (some lacks). I tested on web chrome, poweraps IOS and android with the same results.

     

    I choose to presenting data in another way 🙂

  • PaulD1 Profile Picture PaulD1 2,914
    Posted at
    PowerApps Sub Galleries: Expanding and Collapsing

    Hi @Lionel

     

    You only need to reduce your dataset for development purposes. I just use a Filter or a FirstN (https://docs.microsoft.com/en-us/powerapps/functions/function-first-last) on the gallery's item property to ensure I am working with a dataset small enough that it won't crash the web designer. When finished designing, remove the Filter or FirstN and Publish.

     

    Hope that helps

    Paul

  • Lionel Profile Picture Lionel 5
    Posted at
    PowerApps Sub Galleries: Expanding and Collapsing
    Thank you for your answer. Unfortunately I could not reduce the dataset ; I will find another way
  • PaulD1 Profile Picture PaulD1 2,914
    Posted at
    PowerApps Sub Galleries: Expanding and Collapsing

    Hi @Lionel 

     

    Yes, there appears to be a bug in the designer which means that it will often crash when using the Gallery/Subgallery approach with a larger dataset. For development/testing, try to work with a small dataset to prevent this.

     

    If text wraps over several lines then it may not display well (remember we count the number of records and then multiply by a line height - so if the line height changes or the text doesn't fit on a line it doesn't look great). Assuming the records fit on single lines I've found it *mostly* looks OK, though I have seen the occasional 'glitch' especially in the Web viewer and on Windows Mobile. iOS and Android seem to suffer less from display issues in my experience.

  • Lionel Profile Picture Lionel 5
    Posted at
    PowerApps Sub Galleries: Expanding and Collapsing

    Hello and thank you for the share.

     

    Is there a limitation in the number of items. I use your solution for my own need and I face up an issue while drilling down the upper list (groupedItems)

    - in dev mode : it crashes ("WebAuthoring abnormal termination.") / see error message detailed below

    - In production there is no error message but the list of grouped items is not very well displayed after some lines

     

    Detailed error massage :

    WebAuthoring abnormal termination.
    Client date/time: 2018-01-20T17:27:06.441Z
    Version: 2.0.750 (v2.0.750.64884645)
    Session ID: f3d37a67-df0a-46f6-8193-90e138358b4b
    description: {"error":{"isTrusted":true,"detail":{"exception":{}},"message":"Uncaught TypeError: Cannot read property 'style' of null","filename":"https://cdn-paaprodweu.azureedge.net/v2.0.750.64884645/studio/ctrllib/gallery/js/gallery.js?v=2.0.750.64884645","lineno":1,"colno":45038,"error":{},"NONE":0,"CAPTURING_PHASE":1,"AT_TARGET":2,"BUBBLING_PHASE":3,"type":"error","target":"[window]","currentTarget":"[window]","eventPhase":2,"bubbles":false,"cancelable":true,"defaultPrevented":false,"composed":false,"timeStamp":887729.1050000001,"srcElement":"[window]","returnValue":true,"cancelBubble":false,"path":["[window]"],"composedPath":"[function]","stopPropagation":"[function]","stopImmediatePropagation":"[function]","preventDefault":"[function]","initEvent":"[function]"},"errorLine":1,"errorCharacter":45038,"errorUrl":"https://cdn-paaprodweu.azureedge.net/v2.0.750.64884645/studio/ctrllib/gallery/js/gallery.js?v=2.0.750.64884645","errorMessage":"Uncaught TypeError: Cannot read property 'style' of null","setPromise":"[function]","exception":{}}
    stack: null
    errorNumber: 0
    errorMessage: Uncaught TypeError: Cannot read property 'style' of null