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 / Combining two sharepoi...
Power Apps
Answered

Combining two sharepoint lists using existing and same column names

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello everyone. I have a powerapp that uses 2 lists as data sources. List 1 has a parts column and a vendorname column, and is about 500 rows long and growing. List 2 has vendorname, address, contact# columns and is 29 rows long. I want to join these so list 1 pulls the contact info from list 2. The best way for me to explain this is by simulating a VLOOKUP in excel. That would be simple. I have tried using a LOOKUP in List 1, but I need to go back and in the lookup column choose the vendor name, even though it is in the column right next to it. Is there a way to use the existing vendorname column to join them together?

 

thank you!

 

Chris

Categories:
  • Verified answer
    WarrenBelz Profile Picture
    156,545 Most Valuable Professional on at

    Hi @Anonymous ,

    The Items of a gallery would be something like this (note you would not need the top statement if you had different names for the common field)

    With(
     {
     wVendors:
     RenameColumns(
     List2,
     "vendorname",
     "vendor"
     )
     },
     AddColumns(
     List1,
     "Address",
     LookUp(
     wVendors,
     vendor = vendorname
     ).Address,
    	 "ContactNo"
    	 LookUp(
     wVendors,
     vendor = vendorname
     ).'Contact#'
     )
    )

     

    Please click Accept as solution 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 Thumbs Up.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thank you for the quick reply!  I've tried using this a few different ways this morning with no luck.  Im pretty new to Powerapps so Im sure that plays a large part in seeing what the code is trying to do.  If I remove the top part, all the way up to AddColumns, I kinda understand the rest of the code.  What is the wVendors looking to do?  Should there be a reference to list2 in the bottom portion of the code?

     

    Thanks again!

    Chris

  • Verified answer
    WarrenBelz Profile Picture
    156,545 Most Valuable Professional on at

    Hi @Anonymous ,

    wVendors (you can call it whatever you want) is simply List2 with a renamed column to avoid the ambiguity of comparing two fields with the same name.

    The code simply adds two new columns based on a LookUp to the second list - note I have assume field names here.

     

    Please click Accept as solution 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 Thumbs Up.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thank you for your help!

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 405 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 368

#3
WarrenBelz Profile Picture

WarrenBelz 244 Most Valuable Professional

Last 30 days Overall leaderboard