cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jernejp
Level: Powered On

Renaming multiple fields and joining tables

Hi,

 

I have a table PersonList with fields: Contact_Id, Contact_Name and Contact_Email
Then I have a table Employees with fields: Employee_Id, Employee_Name, Employee_Email and Status

 

How would I go about renaming Contact_id to ID and Employee_Id to ID (and doing the same for other columns as well) and then joining everything in one table?
The solution I have for now is to set temporary tables and rename columns one by one (for example):

Set(PersonListTemp; RenameColumns(PersonListTemp; "Contact_Id"; "ID"));;

But there has to be a way where I don't have to make so many new tables?

 

Thanks in advance!

1 REPLY 1
Community Support Team
Community Support Team

Re: Renaming multiple fields and joining tables

Hi @jernejp ,

Could you please share a bit more about your scenario?

Do you want to rename column names within your underlying tables (original tables)?

 

If you want to rename column names within your underlying tables (original tables), I afraid that there is no way to achieve your needs in PowerApps currently.

 

As an alternative solution, you could consider create a temporary table for each of your original table with renamed columns, then merge the temporary tables into single one table.

 

I have made a test on my side, please take a try with the following workaround:

Set the OnSelect property of a button to following:

ClearCollect(
               MergedTable,
               RenameColumns(PersonList, "Contact_Id", "ID", "Contact_Name", "Name", "Contact_Email", "Email"),
RenameColumns(Employees, "Employee_Id", "ID", "Employee_Name", "Name", "Employee_Email", "Email") )

Then you could use the MergedTable as data source within your app.

Note: The PersonList represents your Person List table, the Employees represents your Employees Table.

 

More details about the RenameColumns function, please check the following article:

RenameColumns function

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Demo Extravaganza Championship Voting Open

Voting Ends: October 30, 2019!

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 190 members 4,656 guests
Please welcome our newest community members: