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 / Matching IDs in two li...
Power Apps
Unanswered

Matching IDs in two lists - code syntax problem

(0) ShareShare
ReportReport
Posted on by 12

Goodmorning everyone,

first of all I would like to explain my problem, taking into account the fact that I am a beginner with databases and this platform:

I'll start by explaining which are the lists in Sharepoint that are used as a database for the App in PowerApps.

  • there is a "Customers database" list containing all the names of the customers, with their main information.
  • there is a "Key Contacts" list in which all the contacts relating to a specific customer are present
  • and so on...

 

the main problem is that by creating the lists, each Costumers (in the Costumers database) will have an ID, and within the Key Contacts, each Contact will have another ID ...

however a customer can have multiple contacts, so I thought of putting a secondary ID in the Key Contacts list, the problem is that it should be updated manually every time, making the costumer ID (Costumers Database) equal to the new secondary ID in the Key Contact, but doing so would be inconvenient ... I wanted to ask you: is there an automatic way to correlate the IDs in the two lists?

 

Trying to work around this problem, I thought of inserting a formula, in which I match not the IDs, but the names… to bypass the problem, but it gives me this error (maybe I have wrong the syntax):

 

codice.PNG

 

App screen:

 

schermata app.PNG

 

List in SharePoint:

 

sharepoint, companyname.png

 

I wanted to ask you for a hand in this regard, both for the first case, and (possibly if not possible), for the second.

Thank you!

 

Matteo.

 

Categories:
  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    Try this instead,

     

    Filter('Key Contacts'; Company_x0020_name in GalleryCustomer.Selected.'{Name}')

  • matteoseni Profile Picture
    12 on at

    Thank a lot for the reply! But unfortunately it doesn't work.. as below:

     

    matteoseni_0-1616417607757.png

     

    And the field name in the Customers Screen (app screen referenced by the selected item), is correct, as below: ( {Name} )

     

    matteoseni_1-1616417818313.png

     

    Thank you very much if you can help me!

     

  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    Where is Company_x0020_name coming from?  Is it a field that someone has selected or something else?

     

    Also can you translate your error for me?

  • matteoseni Profile Picture
    12 on at

    Company_x0020_name is the field name of the "Key Contacts" list in SharePoint.

    and this field is the same as the name shown in "{Name}" in the screenshot I attached above (Gallery Costumer).

    Precisely I would like that when the {Name} selected in the Costumer Gallery, is found in the "Company Name" column in Key Contacts, it gives me back the Company_x0020_name, that is the Company Name.

    (it is only an explanatory example, to project a result, taking into account the same name).

     

    the error simply says that the formula contains an error, and to examine the formula and run it again.

     

    Thank you!

  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    Instead of this:

     

    Filter('Key Contacts'; Company_x0020_name in GalleryCustomer.Selected.'{Name}')

     

    Can you try this:

     

    Filter('Key Contacts'; Company_x0020_name in GalleryCustomer.Selected.Name)

  • matteoseni Profile Picture
    12 on at

    matteoseni_0-1616420376567.png

     

    "the name is invalid. unrecognized identifier".

    I think he expects an ID, but unfortunately as I anticipated, it is not possible for me to equate them between the lists

     

  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    Ok, I have never seen that require {} around the identifier.

     

    If you remove the Name at the end of the formula, do you get a dropdown with selections?   Is Name one of the selections?

  • matteoseni Profile Picture
    12 on at

    Yes:

    matteoseni_0-1616421052206.png

     

    Or, would there be a different way to do what I need? exactly display all the lines of the Key Contacts list, whose "Company Name" field is the same as the one selected in the Costumers Screen?

     

    Thank you

     

     

     

  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    Please excuse all the questions, different language versions of Power Apps work a little differently.

     

    Can you try Filter('Key Contacts'; 'Company Name' in GalleryCustomer.Selected.'{Name}')

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 393 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 278 Most Valuable Professional

Last 30 days Overall leaderboard