Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

Compare two collections and return values

(1) ShareShare
ReportReport
Posted on by

I have two collections in Power Apps: ValoresDropDown and ValoresGalleryText.

I need to compare ValoresGalleryText with ValoresDropDown, where ValoresDropDown is the base and ValoresGalleryText is the current one. I need it to perform this comparison and return the values that are missing in relation to the base collection (ValoresDropDown).

 

 

  • Suggested answer
    SL-11020816-0 Profile Picture
    23 on at
    Compare two collections and return values
    I find this:
     
    By refining the code to display only the items that differ between the two collections, we arrive at the following:
     
    ClearCollect(
        col_MissingValue;
        ShowColumns(
            Filter(
                AddColumns(
                    ValoresDropDown ;
                    MatchFound;
                    !IsBlank(
                        LookUp(
                            ValoresGalleryText;
                            Value = ValoresDropDown[@Value]
                        )
                    )
                );
                MatchFound = false
            );
            Value
        )
    );;
    I hope this has been helpful or provided some guidance. Best regards.
  • Suggested answer
    MichaelFP Profile Picture
    1,827 Super User 2025 Season 1 on at
    Compare two collections and return values
    Hello!
     
    You can do it a for all for that.
     
    Clear(MissingItems);
    ForAll(ValoresDropDown as VD,
         If(IsBlank(Lookup(ValoresGalleryText,Value = VD.Value)),Collect(MissingItems,VD.Value))
    );
     
    You will iterate all of the ValoresDropDown Values and try to find these values im ValoresGalleryText, If the Lookup() is blank means that the current value is missing in ValoresGalleryText, and you include in a new collection to have the list of missing values.
     
     

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

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,908 Most Valuable Professional

Leaderboard