Skip to main content

Notifications

Community site session details

Community site session details

Session Id : JiCn3nAuwL5zQLAHf88+Cr
Power Apps - Building Power Apps
Answered

Show items in a gallery which are not present in another gallery

Like (0) ShareShare
ReportReport
Posted on 14 Dec 2018 08:35:54 by 46

Hi

I need to show items in a gallery which are not present in another gallery and am not sure how to do it.

My scenarion is like this. A user goes to a NewForm of a listX. That form has a gallery control pointing to Title column of another list, ListA.
In the NewForm of ListX,user selects a few items from ListA gallery using checkbox and then submits the form. The selected items of ListA are submitted to another list,ListB (Region column) along with the ID (RefID column) of the item that got created in ListX .
In the editform of ListX,I have galleryB which filters ListB where ListB.RefID=ListX.ID ->This shows all items user had selected in NewForm.
I would like to show items in another gallery, galleryA which are not present in galleryB.
This would be something like Filter ListA where ListA.Title not in ListB.Region . It could also be Filter ListA where ListA.Title not in galleryB.Region.
I am not able to do this. For example, Filter(ListA,Title not in galleryB.AllItems.Region ->Does not work. Please help

Categories:
  • WarrenBelz Profile Picture
    146,804 Most Valuable Professional on 15 Dec 2024 at 20:40:15
    Show items in a gallery which are not present in another gallery
    What is your data source type and how many records do you have ?
    May be a silly question, but do you actually have records that match both as it makes no sense that they work separately, but not joined by And. As a debugging exercise, try || (Or) instead and see if it produces a combination of the two. Also try in instead of exactin and see if that makes a difference.
  • RM-06090351-0 Profile Picture
    36 on 15 Dec 2024 at 15:10:47
    Show items in a gallery which are not present in another gallery
    Hi WarrenBelz,

    Thanks for your advice and I've tried using your suggested formula but still got a blank Gallery.

    It's also strange to notice that the Gallery will show items when either one of the filters below was being used: -

     
    - !StartsWith('Store Code',"HK7")
    - Not('Store Code' exactin Gallery_Completed.AllItems.Value)

    Of coz, none of the situations gave me the correct items in the Gallery.

    Your further advice and suggestion is much appreciated.

    Thanks
    Raymond
  • WarrenBelz Profile Picture
    146,804 Most Valuable Professional on 15 Dec 2024 at 11:15:06
    Show items in a gallery which are not present in another gallery
    You have all sorts of Delegation issues there - assuming that Gallery_Completed has a field called Value, try this
    With   
       {
          _Data:
          Filter(
             'HK & Macau Store information Latest',
             Division = Label_CityArea.Text
          )
       },
       Filter(
          _Data,
          !(
             StartsWith(
                'Store Code',
                "HK7"
             )
          ) &&
          !(
             'Store Code' exactin Gallery_Completed.AllItems.Value
          )
       )
    )
     
    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    Buy me a coffee
  • RM-06090351-0 Profile Picture
    36 on 15 Dec 2024 at 07:22:24
    Show items in a gallery which are not present in another gallery
    Hi there, 

    I also have a similar need to show items from SP List A excluding those items in SP List B. Then I use a formula similar to the one from Mr. Dang as below. It however gave me a blank page but gave me all items if I omitted the "Not".

    I've tried many other options but still cannot figure it out.

    Your support is much appreciated.

    Thanks
    Raymond

     
        Filter(
            'HK & Macau Store information Latest',
            Division = Label_CityArea.Text
            &&
            !StartsWith('Store Code',"HK7")
            &&
            Not('Store Code' exactin Gallery_Completed.AllItems.Value)
        )
     
  • AnonyMouse Profile Picture
    46 on 14 Dec 2018 at 10:51:20
    Re: Show items in a gallery which are not present in another gallery

    Perfect. Thanks a lot!

    One more quick question. I was wondering if you know how to put the gallery control inside a datacard.

    My issue is that, in the EditForm, when I insert the gallery control, it is superimposed over the editform. When I scroll in the EditForm, I would like the gallery control to come at the end of the form. But now, as soon as I insert the gallery control, it is shown on top always even if I scroll on top. I tried inserting a datacard to the eiditform and inserting a gallery in that but it made no diference however I noticed that I can insert any normal controls onto the custom card and they work fine. Could you please let me know how can I make the gallery control to come at the end of the editform scroll? Thanks

  • Verified answer
    Mr-Dang-MSFT Profile Picture
    on 14 Dec 2018 at 09:03:09
    Re: Show items in a gallery which are not present in another gallery

    Hi @AnonyMouse,

    You're very close. It looks like just a matter of placing Not in the right spot.

     

    Filter(ListA,Not(Title exactin galleryB.AllItems.Region))

    This means, "Filter ListA to only show records where the Title of a given record does NOT appear in the Region column of galleryB."

     

    Let me know if I understood this scenario correctly.

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Building Power Apps

#1
MS.Ragavendar Profile Picture

MS.Ragavendar 20

#2
BCBuizer Profile Picture

BCBuizer 10 Super User 2025 Season 1

#2
LC-26081402-0 Profile Picture

LC-26081402-0 10

Overall leaderboard
Loading started