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 :
Power Platform Community / Forums / Power Apps / How to hide a label of...
Power Apps
Unanswered

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

(0) ShareShare
ReportReport
Posted on by 2

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.

 

 

Categories:
I have the same question (0)
  • v-qiaqi@microsoft.com Profile Picture
    on at

    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

  • MIA27 Profile Picture
    2 on at

    But the field is inside the gallery, not outside.

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

     

    pls guide

     

  • MIA27 Profile Picture
    2 on at

    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)

  • v-qiaqi@microsoft.com Profile Picture
    on at

    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
    2 on at

    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

     

     

     

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    on at

    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 

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard