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 Platform Community / Forums / Power Apps / Compare two collection...
Power Apps
Suggested Answer

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).

 

 

Categories:
I have the same question (0)
  • Suggested answer
    MichaelFP Profile Picture
    1,991 Moderator on at
    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.
     
     
  • Suggested answer
    SL-11020816-0 Profile Picture
    23 on at
    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.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 914

#2
11manish Profile Picture

11manish 627

#3
Valantis Profile Picture

Valantis 598

Last 30 days Overall leaderboard