Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

How to hide a label of a gallery from 2nd records onward

(0) ShareShare
ReportReport
Posted on by

I want to hide a label in the gallery from the second records onward, if the label text is not Blank.

 

Please guide is it possible by coding.

 

 

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    on at
    Re: How to hide a label of a gallery from 2nd records onward

    Hi @MIA27,

    Absolutely the Visible property of the Label you want to hide.

    The formul set for Visible property expects a boolean value like true or false, I provide the formula does return true or false.

     

    The second part is to check if the first record is blank.

    In my formula, you could replace the Primary Key with your RecoID 

  • MIA27 Profile Picture
    on at
    Re: How to hide a label of a gallery from 2nd records onward

    I need to apply in the label visible property or in gallery property.

    Getting confused.

     

    I added a field RecoID - set it to autonumber, which will help me find the first record on sorting.

    Will be adding a label inside the gallery template, to fetch RecoID for code to compare

     

    Just for my learning/understanding, how it will be working:

    It will check RecoID = 1st record

    but second part of the code, I am not able to understand as it no space near &&

     

    Sorry, I want to understand, implement and learn, so that the same method can be used at several places as required

     

    Pls. advise

     

     

     

  • v-qiaqi@microsoft.com Profile Picture
    on at
    Re: How to hide a label of a gallery from 2nd records onward

    HI @MIA27,

    So if the first record is not blank, then  hide the second records onward?

    Well, you need to define a primary key in your Dataverse table, so that we could capture the record directly.

     

    We need to capture the first record by this primary key, so does the second onward records.

    Sort by this primary key column by ascending, check if this primary key is the minimum, and check if thisItem is blank using LookUp():

    ThisItem.PrimaryKey=First(SortByColumns(Data,"PrimaryKey",Ascending)).PrimaryKey&&!IsBlank(LookUp(Data,PrimaryKey=First(SortByColumns(Data,"PrimaryKey",Ascending)).PrimaryKey).FieldName)

     

     

  • MIA27 Profile Picture
    on at
    Re: How to hide a label of a gallery from 2nd records onward

    my gallery is based on Dataverse table in teams, not share point,

     

    so as you know the ID field is not available in Dataverse Table, (auto created same like SP)

  • MIA27 Profile Picture
    on at
    Re: How to hide a label of a gallery from 2nd records onward

    But the field is inside the gallery, not outside.

    So if first record then only show else next onward dont show,

     

    pls guide

     

  • v-qiaqi@microsoft.com Profile Picture
    on at
    Re: How to hide a label of a gallery from 2nd records onward

    Hi @MIA27,

    Could you please tell me that you want to hide the label from the second records onward by checking which label is not blank?

     

    If this label is out of the gallery, you could use the following formula for the Visible property of the Label in Gallery

    !IsBlank(Label.Text)&&ThisItem.ID<>1

    Assuming that you have records from SP list and sort by ID

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,660 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,004 Most Valuable Professional

Leaderboard