Skip to main content

Notifications

Power Apps - Building Power Apps
Unanswered

How to compare two galleries

Posted on by 2
Hello, I have created two galleries that are linked to two different databases. I'd like to compare the items in these two galleries. The item is Site label. If the text has the same value, I'll display it as follows. It's possible ?
  • Suggested answer
    Ammar Zaied Profile Picture
    Ammar Zaied 97 on at
    How to compare two galleries

    it's possible to compare the items between two galleries and display them if the Site label has the same value. Here’s a basic way to achieve this in Power Apps:

    Steps:

    1. Assume two galleries, Gallery1 and Gallery2, are linked to two different data sources. Each gallery has a text label showing the Site label.

    2. Add a label to your screen where you want to display the matching Site labels.

    3. Use a formula to compare the items in the two galleries. Here's an example of how you can do it:

    ForAll(Gallery1.AllItems, 
        If(
            !IsBlank(
                LookUp(Gallery2.AllItems, SiteLabel = ThisRecord.SiteLabel)
            ), 
            Concat(ThisRecord.SiteLabel, Text(ThisRecord.SiteLabel) & ", ")
        )
    )
    

     

    Explanation:

    • ForAll(Gallery1.AllItems, ...): Loops through all the items in Gallery1.
    • LookUp(Gallery2.AllItems, SiteLabel = ThisRecord.SiteLabel): Searches for the item in Gallery2 where the Site label matches the current item in Gallery1.
    • Concat: Combines all the matching Site labels from the galleries.
    • ThisRecord.SiteLabel: Refers to the Site label in the current record of Gallery1.
     
  • Suggested answer
    FLMike Profile Picture
    FLMike 29,366 on at
    How to compare two galleries
    Hi
     
    Unfortunately no matter how many times I load your question, I see nothing below your words, so :-( I am unable to help you much.
     
    But you aren't really comparing the galleries, you care comparing just a single Column correct?
     
     

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,591

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,090

Leaderboard