web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Check list for duplica...
Power Apps
Answered

Check list for duplicates and remove from gallery if found

(0) ShareShare
ReportReport
Posted on by

Hello everyone,

 

I've got an app that allows people to view documents and then confirm they have read and understood it. This confirmation is stored on a SP list and contains the document name and it's current version (the list of available documents is stores on another list). What I'd like is for that document version to be removed from the gallery once they have acknowledged it. 

 

I've used something like this in the past to check for duplicates and popup a warning if it's found

 

Set( varNAME, LookUp( LISTNAME, Title = lblFilename.Text )

 

 However, this time I need it to not display the document if one with the same name and version is found?

 

I'm assuming this is possible with a little help from the experts out there!

Categories:
I have the same question (0)
  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    You can do a LookUp the same way you did

     

    After that you must check if it is empty or not. You can use Function IsEmpty() or IsBlank.

    That will return true or false.

     

    https://docs.microsoft.com/en-US/powerapps/maker/canvas-apps/functions/function-isblank-isempty

     

    If you need additional help please tag me in your reply and please like my reply.
    If my reply provided you with a solution, pleased mark it as a solution ✔️!

    Best regards,
    Gonçalo Nogueira

    Check my LinkedIn!

    Check my User Group (pt-PT)!

    Last Post on Community

    My website!

  • v-qiaqi@microsoft.com Profile Picture
    on at

    Hi @Doddy83,

    Do you want to delete the document in the Gallery if is is duplicated?

    Could you please share a bit more about your scenario?

     

    If you want to delete the document in the Gallery using a delete button, you could directly insert a delete icon or trash can icon within the Gallery and set the OnSelect as below:

    RemoveIf(ListName,LookUp( LISTNAME, Title = lblFilename.Text ))
  • Doddy83 Profile Picture
    on at

    Many thanks both the the replies and sorry I obviously didn't provide enough information. 

    What I have are two galleries (A & B), One that displays all of the available documents people can read  and acknowledge (Gallery A) and another that displays a list of documents that person has already acknowledged (Gallery B). Each List also has a column for the version of the document.

     

    What I'd like if possible, is to NOT display the document in Gallery A if there is a matching document name and version in Gallery B. this is to prevent them from acknowledging the same document and version multiple times.

     

    Does this make more sense? I don't need to delete duplicated, just not display them in gallery A if they are already in Gallery B (with matching versions). I've been struggling trying to get my initial formula to work in this instance, even with the IsBlank( added to the end.

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    on at

    Hi @Doddy83,

    Here is what I got, please check if it is correct.

    You have different galleries to display available docs and already acknowledged docs. You want to filter out the docs in the Gallery A that exists in the Gallery B, right?

     

    If so, please set the Gallery A Items property as below:

    Filter(ListA,!(Version_ListA in ListB.Version_B))

    You just need to filter out the records that have the same version with those from the list B.

     

     

  • Doddy83 Profile Picture
    on at

    That's correct, except I also need it to check for the doc name too, as there are multiple documents available. I think I should be able to put something together from what you have provided above so many thanks for that. I'll confirm when I get a chance to test it.

     

    Thanks again!

  • Doddy83 Profile Picture
    on at

    Created collections to avoid delegation issues but my final formula that does work to filter out duplicate documents using Title and Version.

     

    Many thanks or the pointer.

     

    Filter(
    DocAckRegCollection,!(Title in AckDocsCollection.Title && DocumentVersion in AckDocsCollection.DocumentVersion))

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard