Published: May 14, 2020 / Updated: Jul 30, 2024
I was recently building a Power App for a work project and needed to have a combo box display the primary text field from one data source, while having the secondary text field display from another data source. Here’s how to display 2 data sources in a Power Apps combo box:
We will be using the AddColumns and LookUp functions to essentially find a record that matches our criteria, while joining two tables together.
According to the documentation, here are the descriptions for each function respectively:
The AddColumns function adds a column to a table, and a formula defines the values in that column. Existing columns remain unmodified.
The formula is evaluated for each record of the table.
The LookUp function finds the first record in a table that satisfies a formula. Use LookUp to find a single record that matches one or more criteria.
To break it down: AddColumns(Table1, “New Column Name”, LookUp(Table2, ‘Column We Want to Look Up’ = Table2[@Table We Have to Compare Against], ‘Column We Want To Return’))
In the example below, I’m adding a column named “Account Name” to the Projects table. In order to find my “Account Name”, I am using the LookUp function to search the Accounts table for a record that matches “Account ID = Projects[@Account]”. The last argument of LookUp means I only want to return the “Account Name” column from the Accounts table.
AddColumns(
Projects,
"Account Name",
LookUp(
Accounts,
'Account ID' = Projects[@Account],
'Account Name'
)
)
We’ve now added a new column called “Account Name” (from the Accounts table) to the Projects table in our combo box.
This can be confusing at first, but if you need to pull data and combine tables from 2 data sources in a Power Apps combo box, you now know how!
Interested in more workplace automation? Check out this article on Creating a Resume Builder in Power Apps.
Whether you're just getting started or ready to grow, Sparrow Leads™ gives your business the tools and lift it needs to soar online. Take the next step — your flight path begins here.