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.
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
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
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)
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)
But the field is inside the gallery, not outside.
So if first record then only show else next onward dont show,
pls guide
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
WarrenBelz
146,660
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,004
Most Valuable Professional