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 / Problem matching two s...
Power Apps
Unanswered

Problem matching two sets of lists !

(0) ShareShare
ReportReport
Posted on by 171

Hi

Slowly getting an app together - however brain has stopped on this one.

All references are from sharepoint lists - I do not use lookups as imported from Azure.

I have a list that holds lookup IDs for Quotations, Clients and Contacts.The list is called People ( don't ask !)

I have a screen that shows all contacts connected to a single client connected to a single quotation. - a collection CContacts

Each contact has a client ID in its record as no contacts work for more than one client.

I want to display a gallery with all contacts that are connected to a client but who are not connected to a quotation.

So I can get a list of Contactids for the client, ID1,ID4,ID6,ID8 call it clientcontact

I can get a list of all contactids in the People list with matching quotation ID and Client ID. say ContactID 1,ID6 - from the CContacts collection

How do I get a collection that will hold contacts IDs 4 and 8. 

I can get the in function to work on one clientcontactID in CContacts (Contact column) but I can't see how to run a for all on   as it says in the help that this will not run on a collection

All ideas gratefully received

 

Cheers

 

Richard

 

 

 

Categories:
  • v-yamao-msft Profile Picture
    Microsoft Employee on at

    Hi rlmckean,

     

    I am not clearly with your scenario.

     

    Could you give me more clarification?

     

    Best regards,
    Mabel Mao

  • rlmckean Profile Picture
    171 on at

    Hi Mabel -

    Just going out - will rfeply later thanks

    Richard

     

  • rlmckean Profile Picture
    171 on at

    Hi again Mabel

    so its like this.
    I have a quotation list that gets filtered into a collection 'quotes' for all quotations for an enquiry -
    (we quote to different clients for the same enquiry). The 'quote' s collection holds the enquiry ID (quoteno), same for all rows in the collection, and clientid , different for each row in the collection.
    Each client has contacts attached to it by utilising a field in the Contacts list in a column which holds the clientid.
    Not all client's contacts are attached to each quotation so there is a 'matching' list 'People' . Each row in People holds a quoteno, clientid,contactid.
    The schema is like this
    Enquiry     Quotes     Clients     Contacts       People
    Quoteno   Quoteno    Clientid      ContactID      Quoteno
                     Clientid                       Clientid          Clientid
                                                                              ContactID

     

    When a user wants to attach the first contact to the Enquiry, A collection CContacts filters the Contact list by Clientid , the clientid coming from the Quotes list. When a contact is selected from the gallery , a record is patched to People with relevqant three IDs 

     

    When a user wants to view the contacts attached to a quotation, list 'People' is filtered by ( quoteno and clientid) into a collection Qcontacts . This loads a gallery with the attached contactids and data .

     

    The problem I have then is when a user wants to link a second contact, I have to have a further collection that will filter only those contact IDs from the CContact collection that are NOT contained within the collection Qcontacts. ie Client contacts that exist but that are not allocated to the quote.

    This is where I hit a wall in in understanding the Forall etc. In Access, I would run a for each..endfor or a do while endo construct. I have messed around with the countrow function etc but not got anywhere

    I am sure you will have an easy solution I have missed - have a good weekend

    Cheers

    Richard

  • rlmckean Profile Picture
    171 on at

    Hi MAbel

    I have narrowed this down now to this. 

    If I set Items in a gallery to this

    Filter(CContact,COID in Cpeople.Contact)

    I list the contacts in the contact list that are listed in the People collection

    What i need is this 

    Filter(CContact,COID NOT in Cpeople.Contact)

    which lists the contacts exisiting for a client that are not in the people collection - and it does not like it !!!

    Is there a way around this ??

     

    Cheers

     

    Richard

  • rlmckean Profile Picture
    171 on at

    Me again Mabel

    Worked it out down the washing up !

    Filter(CContact,!(COID  in Cpeople.Contact)) works just fine !

    Apologies foir taking up your time reading all this - but writing it down concentrates the old mind and hence - sometimes- solved the problem itself !!

     

    Cheers

     

    Richard

     

  • v-yamao-msft Profile Picture
    Microsoft Employee on at
    Hi rlmckean, I am so glad to hear that you have figured out a solution for this issue. Anytime you got issues when working with Powerapps, please feel free post your issues here, we are always ready to help. Best regatds, Mabel Mao

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 234 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 207 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 169

Last 30 days Overall leaderboard