Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Checking if value exists in another gallery

(0) ShareShare
ReportReport
Posted on by 345

Morning all,

 

So I'm scratching my head a little on this. This is the problem:

 

Capture5.PNG

 

I have two galleries. I want the background of the Staff Name box on the left to turn red if the name of the person appears in the gallery on the right. The gallery on the right is from a collection called staffListForGR, so i'm running the condition against that. It doesn't matter that the ID's are wrong, only that the same name appears. But whatever permutation of the above code i try, it doesn't work, even if it doesn't throw up any errors.

 

Any ideas?

Categories:
  • EpicTriffid Profile Picture
    345 on at
    Re: Checking if value exists in another gallery

    Hi @jaanihsm 

     

    This is an old post, so I had to wrack my brains for what I was talking about back then. I meant that the control's displaymode was set to disabled, so even though i was correctly altering the fill, it was only showing me the disabledfill.

     

    As for you, it might be worth pulling the sharepoint list into a collection and running your check against that. I believe ISBLANK is not delegable to the datasource. This page contains a solution for that in case you want to stay directly connected to the datasource: https://www.matthewdevaney.com/sharepoint-delegation-cheat-sheet-for-power-apps/

  • jaanihsm Profile Picture
    300 on at
    Re: Checking if value exists in another gallery

    Hi @EpicTriffid! What did you mean by it was set to disabled? I am trying to compare parseJSON text value in a gallery vs a SharePoint list and get a delegation warning...Maybe I can count rows in SharePoint list instead if >0 then change color to red.

     

    jaanihsm_0-1714606088772.png

     

     

  • Community Power Platform Member Profile Picture
    on at
    Re: Checking if value exists in another gallery

    Hello @EpicTriffid ,
    I think what you suppose to do is collecting all the items in the first gallery in a collection. Then, do the same for the second one and have a condition to check if it exists or not.
    Find the screenshot below:

    Screenshot (26).png

    If this solves your question, would you be so kind as to accept it as a solution.

    Thanks!

  • Verified answer
    EpicTriffid Profile Picture
    345 on at
    Re: Checking if value exists in another gallery

    Ignore this. It was set to disabled.

  • EpicTriffid Profile Picture
    345 on at
    Re: Checking if value exists in another gallery

    I have also tried this to no avail. Once again, no errors, it just doesn't work:

     

    If(
     CountRows(
     Filter(
     staffListForGR,
     'Staff Name' = Self.Text))>0,
     Color.Red, ColorValue(textboxColour))

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,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard