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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Apps
Answered

gallery validation

(0) ShareShare
ReportReport
Posted on by 457

Hi guys,

I have a requirement.

I want to check gallery row column if it is same value. I want to show the error

Example;

Gallery

1 abcd

2 abcd

  

The second column of both row is same so I want to show the error message.

Gallery

1 abcd

   (error message)

2 abcd

   (error message)

 

Please help me.

@Mike8 

@WarrenBelz 

@RandyHayes 

@Pstork1 

@v-xiaochen-msft 

@timl 

@BCLS776 

@Nogueira1306 

@v-bofeng-msft 

@gabibalaban 

 

 

Categories:
  • Ram Prakash Duraisamy Profile Picture
    5,891 Super User 2026 Season 1 on at

    Hello @Gelos,

     

    Add an Label inside your Galley and Set DEFUALT text as (error message).

     

    Add another Label to Populate Values, in your case it's ABCD ( Consider the label name is ABCDLabel)

     

    Then on Visible of Error Message Label, try writing below code

     

    If(CountRows(Filter(TableName,ColumntoFilterfromTable=ABCDLabel))>0,true,false)

     

    Please mark as Answer if it is helpful and provide Kudos


    Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
    Blog : https://microsoftcrmtechie.blogspot.com

     

  • WarrenBelz Profile Picture
    156,532 Most Valuable Professional on at

    Hi @Gelos ,

    Are you looking for duplicates here and show an error if two rows have the same value? If so put a Label in the gallery with the text of Error (or whatever you want).
    Now the next bit is not simple as you have to refer this back to the actual Items of the Gallery (you cannot refer a gallery to itself). If for example the Items of the gallery were

    Filter(
     MySPList,
     YourFilterHere . . .
    ) 

    and the field name you were comparing was Title, the Visible of the Label would be

    With(
     {
     wRows: 
     Filter(
     SPList,
     Title = ThisItem.Title &&
     YourFilterHere . . .
     )
     },
     CountRows(wRows) > 1 && 
     ThisItem.Title = First(wRows).Title
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Gelos Profile Picture
    457 on at

    Thanks. But I did not understand . What mean columntofilterfromtable please explain this.

  • Ram Prakash Duraisamy Profile Picture
    5,891 Super User 2026 Season 1 on at

    Hello @Gelos,

     

    If(CountRows(Filter(TableName,ColumntoFilterfromTable=ABCDLabel))>0,true,false)

     

    Gallery

    1 abcd

    2 abcd

     

    TableName --> Gallery DataSource Name

    ColumntoFilterfromTable --> Which field abcd Contains.

     

    Please mark as Answer if it is helpful and provide Kudos


    Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
    Blog : https://microsoftcrmtechie.blogspot.com

  • Gelos Profile Picture
    457 on at

    Ok. I will check

     

  • Gelos Profile Picture
    457 on at

    But I used collection not table in gallery so will it work or not

    @rampprakash 

  • Verified answer
    Ram Prakash Duraisamy Profile Picture
    5,891 Super User 2026 Season 1 on at

    Hello @Gelos ,

     

    Instead of table Name use collection name and for ColumntoFilterfromTable use column name from the collection thats it.

     

    Please mark as Answer if it is helpful and provide Kudos


    Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
    Blog : https://microsoftcrmtechie.blogspot.com

  • Gelos Profile Picture
    457 on at

    Thank you. It works fine

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 411 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 338

#3
WarrenBelz Profile Picture

WarrenBelz 256 Most Valuable Professional

Last 30 days Overall leaderboard