Skip to main content

Notifications

Community site session details

Community site session details

Session Id : va6U2k/ezANQiunoAFpXD0
Power Apps - Building Power Apps
Answered

how to add a static blank gallery item to a gallery?

Like (0) ShareShare
ReportReport
Posted on 18 Nov 2022 14:40:46 by 496

Hello everyone,

 

I hope all is well,

 

My Concern:

I have a gallery that displays data from a table in dataverse.

I want to add a blank static item to this gallery, where I'm going to add static text in it.

 

What I have:

Roberto_el_Hajj_0-1668782204476.png

 

I want to add an additional item to this gallery that does not exist in the filtered table so I can make a pop-up visible whenever it's pressed. 

To make things easier, please find below a representation of the additional item that I need to add:

Roberto_el_Hajj_1-1668782376650.png

 

 

Thus, how this can be done?

 

Any help would be highly appreciated,

 

Thank you

 

 

  • RobHajj98 Profile Picture
    496 on 18 Nov 2022 at 16:30:21
    Re: how to add a static blank gallery item to a gallery?

    I really appreciate your fast response and help @WiZey.

    Thank you ๐Ÿ‘

  • WiZey Profile Picture
    3,023 Super User 2025 Season 1 on 18 Nov 2022 at 16:23:12
    Re: how to add a static blank gallery item to a gallery?

    I'm glad the problem was spotted quickly!

     

    Let me know if it works fine, or if you need help on something else.

  • Verified answer
    RobHajj98 Profile Picture
    496 on 18 Nov 2022 at 16:16:55
    Re: how to add a static blank gallery item to a gallery?

     @WiZey, I missed that one ๐Ÿ˜‚

    My filter condition caused the problem, so the solution is to patch the "EmpID" and the "Active" status to the blank record to fix this.

     

  • SebS Profile Picture
    4,146 Super User 2025 Season 1 on 18 Nov 2022 at 16:15:42
    Re: how to add a static blank gallery item to a gallery?

    How I manage to do that I'm confuse ๐Ÿ™‚ **bleep** My Apologies

  • Verified answer
    WiZey Profile Picture
    3,023 Super User 2025 Season 1 on 18 Nov 2022 at 16:06:23
    Re: how to add a static blank gallery item to a gallery?

    @SebS I'm afraid you answered to the wrong topic?

     

    @Roberto_el_Hajj Have you tried adding the code below in your "OnSelect" of your button:

     

    ClearCollect(
     'Employee Leave Balances Col',
     'Employee Leave Balances'
    );
    Collect(
     'Employee Leave Balances Col',
     Defaults('Employee Leave Balances')
    )

     

    Also, I see some conditions in the "Filter()" you provide to your gallery. I'm guessing this is what is "masking" the blank record because it is filtered out.

     

    Can you try adding another condition to try and keep the blank record? Perhaps something like this:

     

    Filter(
     'Employee Leave Balances Col',
     'Employee Number'.No = EmpID,Status = 'Status (Employee Leave Balances)'.Active,
     IsBlank('Employee Number'.No) //Blank record should have blank number, right?
    )

     

  • SebS Profile Picture
    4,146 Super User 2025 Season 1 on 18 Nov 2022 at 15:59:15
    Re: how to add a static blank gallery item to a gallery?

    What if create a gallery with Sequance() in its place in Sequence number of Tiles you are looking for and then nest the other gallery in it that means you have a full control and avoid any delegation issues when you use collection keep in mind it can hold only 2000 records.

     

    just an idea 

  • RobHajj98 Profile Picture
    496 on 18 Nov 2022 at 15:58:30
    Re: how to add a static blank gallery item to a gallery?

    Hi @WiZey , that what i thought too.

     

    In my gallery's Items property, I add the below expression:

    Filter(
     'Employee Leave Balances Col',
     'Employee Number'.No = EmpID,Status = 'Status (Employee Leave Balances)'.Active
     
     )

     

    On a separate button (let's call it button 1), I added the below expression to create the collection:

     ClearCollect(
     'Employee Leave Balances Col',
     'Employee Leave Balances'
    )
    
    

     

    And it works fine, the collection has been created and the records are being displayed as expected.

  • WiZey Profile Picture
    3,023 Super User 2025 Season 1 on 18 Nov 2022 at 15:48:42
    Re: how to add a static blank gallery item to a gallery?

    No, it shouldn't be related to any required fields. For example, "Defaults()" return a blank item using the rules from the SharePoint list. If you mentioned a default value in a column it should put the default value in the item.

     

    Could you elaborate on which part in didn't work? What errors are you getting?

     

    Let's try step by step.

     

    The formulas I provided should have created a collection from the "Filter()" plus a blank record. Can you confirm the collection works first with the "Filter()" alone, then with "Defaults()" alone, and then both to see if the collection is populated with all the items?

  • RobHajj98 Profile Picture
    496 on 18 Nov 2022 at 15:41:27
    Re: how to add a static blank gallery item to a gallery?

    Hello @WiZey, I retested the expression you mentioned above, but it didn't seem to work.

    Does it have anything to do with the required fields, or with the lookup even if it makes no sense?

     

  • WiZey Profile Picture
    3,023 Super User 2025 Season 1 on 18 Nov 2022 at 15:07:28
    Re: how to add a static blank gallery item to a gallery?

    Hello @Roberto_el_Hajj ,

     

    My solution was to store the filtered list in a collection with "ClearCollect()", then add a blank record with a follow-up "Collect()".

     

    ClearCollect(
     collection,
     Filter(source,...)
    );
    Collect(
     collection,
     Defaults(source)
    )

     

    The collection will contain all the items from the "Filter()", plus an additional blank record. 

     

    Then I added some conditions to the controls inside the gallery to behave differently if the record was blank or not.

     

    Hope this was helpful to you.

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz โ€“ Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Communityโ€ฆ

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,743 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,089 Most Valuable Professional

Leaderboard