cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tested1
Helper V
Helper V

Concatenate look up fields

Hello, 

 

I have a what seems like a complex problem I will try to explain. Please if you dont get any of it let me know. I will post a quick summary first here and then explain it. I have put some pictures below. Please let me know if more is needed

 

Quick Summary:

  1. I have two SharePoint lists. One a powerapps form for users to fill in. The second contains a master list which contains all the choices and the first list uses this as a look up column
  2. I want to combine a field from the first list with one from the second look up column.

 

Scenario.

  1. I have a powerapps Form on a SharePoint List for users to fill in
  2. One column is say 'Country' and options could be Australia (AUS)...India (IND) etc. To make the Austriala (Aus) choice I created a second list, made columns country, country code and then a concatenate column using a calculated column to combine the two columns (country+code) (See pic 1). I then used a look up column on my original form that gets this 'Concatenate field) for the user
  3. I wanted to keep the country code separate to make up the Name column
  4. Another column is 'Name' on the original list/form for the user to fill in
  5. What I want to do is combine the Name field with the Country field to give say Name_Country. BUT I only want to combine the 'Country Code' column in the second list with the 'Name' column in the original list. So it could be 'Team_AUS' I dont want to combine the Name and the country column because it would be Name_Austriala (AUS)...I only want to combine the country code with the name in a new column called.

Pic 1 shows the second list where I have created the concatenate column which is used as a look up column in my powerapps form (list 1)

Pic 2 shows the 'Country' Column in my Powerapps form (list 1). Here I have chosen to look up the concatenate column but also bring the 'code' column which is hidden from the user (views)

Pic 3 shows my Powerapp form (list 1) but filtered to just show the columns I want to combine. Here you can see I need to combine the 'Name' column with the 'Country:Code' Column 

 

Please if there is any help or tips I would really appreciate it. Sorry this is very difficult to explain. Can it be done in Powerapps to have this autopopulated 'Name' Column which has the 2 columns/look up field combined?

 

I am unsure if this should be in the Microsoft Flow community or SharePoint..but saw similar posts for Powerapps community!

 

112233

9 REPLIES 9
RandyHayes
Super User
Super User

@tested1 

To be clear...are you looking for this to be done automatically through SharePoint, or are you looking to have this appear in your PowerApp?

I personally always consider the business logic of what I am doing and the importance of where it lives.  If you put your logic into a PowerApp, then any entry to your SharePoint list will then be through the PowerApp - not an issue, just a point (although rules of design say that business logic should not exist in the front-end).

If you make the logic happen in Flow, then your SharePoint list can be manipulated through any source and your logic will apply (not exactly putting the logic on the back-end, but at least putting a governor in place to apply your rule).

 

What I am leading to in short is that point in time when you look at a column that doesn't have what you want in it and trace it back to - "oh, that was not entered in PowerApps" - Which, BTW, would be any existing data unless you put in logic in a PowerApp (or Flow for that matter) to "apply" your rule to all other records that already exist.

 

So, what I'm driving at is - are you looking to 1) "sweep" your list and apply this rule, 2) apply this rule for every item created regardless of creation source, or 3) apply the rule for any new entries made through a custom App/Form?

If so, the answers are 1) Flow or PowerApp  2) Flow  3) PowerApp

 

Now these are just suggestions.  The purists would point to obvious other combinations of these, but these are at least the most simplistic starting points to consider.

 

Hope this is helpful.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Hello @RandyHayes . Thank you for the reply!!

 

What do you suggest would be the best way or would be the most pragmatic method?

 

What I was planning to do is hide the 'Name' form or make it Read only in the PowerApps form and have it auto populate once the user has filled in the rest of the form..it could happen once they have clicked submit on the form or automatically while they pick options..whatever is best or easier to do?

 

A user would click new item in the SharePoint list and the powerapp form would appear for them to fill in.

 

P.S there are no existing items on the form, as the form is still in development stage. So everything will be new entries. I think it would be 3? Im not too sure on what you mean by 1 and 2 but I just wanted the concatenate column to appear on the sharepoint list and/or the PowerApp form

 

Thanks. Please let me know if you want more details 🙂

 

@tested1 

So if you're just starting this fresh and are going to be the Interface to your data, then a PowerApp is a fine thing to have.  

 

What I was planning to do is hide the 'Name' form or make it Read only in the PowerApps form and have it auto populate once the user has filled in the rest of the form..it could happen once they have clicked submit on the form or automatically while they pick options..whatever is best or easier to do?


This is completely feasible.  For the most part, since you are just filling in the column with values, it only makes a difference at the point of SubmitForm.  So, in this case, you will set the visibility of the datacard for the Name column to false (or I recommend setting it to the value of a toggle control while you're testing - so you can hide and unhide as you need).  Then you will focus on the Update property of the Name datacard and make sure it is providing the values you want to be submitted back to the list.

 

P.S there are no existing items on the form, as the form is still in development stage. So everything will be new entries. I think it would be 3? Im not too sure on what you mean by 1 and 2 but I just wanted the concatenate column to appear on the sharepoint list and/or the PowerApp form

Yes, sounds like you fall into situation #3 - Go PowerApps!!  

 

I think you're in the right starting point.  Get yourself up to speed on the EditForm.  Focus on DataCards and the primary properties - DataField, Default, Update.  And then post back here with any questions or problems you run into.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Hi @RandyHayes 

 

Thank you for the reply!

 

The main problem is how to create the combined(from multiple other columns including a look up column) column/datafield which auto populates..Question:

 

  1. I am quite new to PowerApps..Do you have any steps or guides on how I would go about setting up this 'combined/concatenated column' from look up columns/datasources in the SharePoint List? I have no idea where to start to try to create a combined auto-populated column from look up column :S.

I really wanted to get this column created asap but its quite difficult to explain what I wanted.

 

Do you understand what I am trying to achieve? Just checking if its clear/viable what I hoped to create

 

Thank you!

@tested1 

So, I can't give you a specific formula to slam-dunk this for you because I don't know your columns, lookups, data, etc.

But, we can start to get close and you can take it from there hopefully, or continue to get some guidance from the posts here.

 

In general, let's imagine that you have a New EditForm.  Let's say we hide the Name DataCard in the form.

Also in the form you have a DropDown selection of the Country.

You can easily do a lookup on the Country list:

   Lookup(CountryList, Title=thisDropDown.Value).Code

 

Then, again in general, you would simply have (for your Update property of the Name DataCard)

   yourTeamNameDataValue & Lookup(CountryList, Title=thisDropDown.Value).Code

 

This would give you, as in your example, Test_01_BRA if, for example, the Brazil country is selected in the DropDown.

 

So...your first step is to brush up on all of the items in this post in Red.

Head on over to the Docs and look into these.

Then, once you get the idea down.  Figure out if you are doing an App (standalone with SharePoint Connection) or a Customized form (within SharePoint interface).

Then let's see what questions roll out from that.

 

I hope this has given some fuel for thought and a boost to the next step.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Thank you @RandyHayes  I will be getting my head around this.. In the mean time just to clarify the steps you mentioned

 

  1. I have a powerapps form connected to a sharepoint list already created with many columns. 
  2. Column one is name - user enters a name e.g. Test in the form
  3. Column two is country - User selects a country. Option could be 'Brazil (BRA)'
  4. Column three is 'Combined' - This would be the steps you said and would hopefully autopopulate to give e.g. 'BRA_Test' by using the lookup in the other list called Country which contains columns, Country name, Country code, Combined (so Brazil, BRA, and Brazil (BRA). This combined column should be read only or hidden from the user

Thats the steps I want to take and will use your reply to drive 🙂 P.S the combined column, 'BRA_Test' I have a few more lookups I wanted to add to it so say BRA_XXX_ZZZ_Test, just more look up columns. But I will start with One (Country code) Since rest will be same steps. This is no problem right/just follow the same steps once I have it working for one column?

 

P.s. do you have a link for the docs hyperlink you mentioned? it says 404 error when I click it

 

Thank you! 🙂

@tested1 

So I had to re-read the post again...it seems that, what I was thinking was, you wanted to hide the Name field from them.  But, perhaps this is all much simpler - you want to just combine the Name and the Country code into the concatenate column...is this correct?

If so, then yes, it is quite straight-forward.

You would only need to do the following on the Update property of the DataCard for the concatenate column:

 ThisItem.Name & "_" & Lookup(CountryList, Title=dropDownBox.Selected.Value).Code

You could hide the concatenate column from the EditForm if you need.

I hope my assumption after closer inspection of your posting is accurate and this is more what you are looking for.

 

Also...I updated the post with the link to the Docs.  Here it is again for reference. That is the functions list.  To read up more on the Controls in PowerApps, take a look over these documents.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

hi @RandyHayes ,

 

That sounds correct! I tried it but received some errors.. The key issue is I need to do the combined column from 2 lists. Is that possible? So one field is in my original list and the second field which is the code is in a separate second list..

 

Would I click on my form and add the second list as a data source? Wont this mess up the existing original form data source? But I was able to select the second list from the second data source ok..so maybe its fine

 

Also the field (Code column)  I want to combine is in a separate column in the second list (See pic) I need to combine this  with my 'Title' column in list 1.. The error seems to be in the dropdownbox etc part. Is there a way to select the 'Code' Column in the second list? Thank you

 

list2.pnglist23.png

@tested1 

So again re-reading your question from the beginning, let me see if this is clear:

List 2 (Teams Request Form) is the list of Country, Code and concatenated columns.

List 1 (I don't know the name of this list) is the list you are working on that has a Lookup column to List 2 and creates two columns in your List 1 - concatenate and Code

 

You want:

  1. To alter the Title column in List 1 to be CountryCode, "_", TeamName (found in the Name column)
  2. The Title column will be hidden from users
  3. Users will select a Country (based on values in List 2) from a drop down control.
  4. The Title column must update with "CountryCodeSelected_TeamName"

So again, your steps will be this:

Step 1:  Add the List 2 as a DataSource in your App. (again, from what I see, you call this "Teams Request Form")

Step 2:  Set the Items of your DropDown control to this formula:

    dataSourceAddedInStep1

    But, to get a little "nicer" in your list, you might consider this instead:

    SortyByColumns(ShowColumns(dataSourceAddedInStep1), "Country"), "Country")  This will give you a sorted list of just countries.

Step 3: Hide your Title DataCard - Set Visible property to false

Step 4: Change your Update property on the Title DataCard to the following formula:

   Lookup(dataSourceAddedInStep1, Country=yourDropDownControl.Selected.Value).Code & "_" & ThisItem.Name

 

That will do what you are looking for (if I have assumed your situation correctly)

 

Hope this helps.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements

Check out the Copilot Studio Cookbook today!

We are excited to announce our new Copilot Cookbook Gallery in the Copilot Studio Community. We can't wait for you to share your expertise and your experience!    Join us for an amazing opportunity where you'll be one of the first to contribute to the Copilot Cookbook—your ultimate guide to mastering Microsoft Copilot. Whether you're seeking inspiration or grappling with a challenge while crafting apps, you probably already know that Copilot Cookbook is your reliable assistant, offering a wealth of tips and tricks at your fingertips--and we want you to add your expertise. What can you "cook" up?   Click this link to get started: https://aka.ms/CS_Copilot_Cookbook_Gallery   Don't miss out on this exclusive opportunity to be one of the first in the Community to share your app creation journey with Copilot. We'll be announcing a Cookbook Challenge very soon and want to make sure you one of the first "cooks" in the kitchen.   Don't miss your moment--start submitting in the Copilot Cookbook Gallery today!     Thank you,  Engagement Team

Announcing Power Apps Copilot Cookbook Gallery

We are excited to share that the all-new Copilot Cookbook Gallery for Power Apps is now available in the Power Apps Community, full of tips and tricks on how to best use Microsoft Copilot as you develop and create in Power Apps. The new Copilot Cookbook is your go-to resource when you need inspiration--or when you're stuck--and aren't sure how to best partner with Copilot while creating apps.   Whether you're looking for the best prompts or just want to know about responsible AI use, visit Copilot Cookbook for regular updates you can rely on--while also serving up some of your greatest tips and tricks for the Community. Check Out the new Copilot Cookbook for Power Apps today: Copilot Cookbook - Power Platform Community.  We can't wait to see what you "cook" up!      

Tuesday Tip | How to Report Spam in Our Community

It's time for another TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   As our community family expands each week, we revisit our essential tools, tips, and tricks to ensure you’re well-versed in the community’s pulse. Keep an eye on the News & Announcements for your weekly Tuesday Tips—you never know what you may learn!   Today's Tip: How to Report Spam in Our Community We strive to maintain a professional and helpful community, and part of that effort involves keeping our platform free of spam. If you encounter a post that you believe is spam, please follow these steps to report it: Locate the Post: Find the post in question within the community.Kebab Menu: Click on the "Kebab" menu | 3 Dots, on the top right of the post.Report Inappropriate Content: Select "Report Inappropriate Content" from the menu.Submit Report: Fill out any necessary details on the form and submit your report.   Our community team will review the report and take appropriate action to ensure our community remains a valuable resource for everyone.   Thank you for helping us keep the community clean and useful!

Community Roundup: A Look Back at Our Last 10 Tuesday Tips

As we continue to grow and learn together, it's important to reflect on the valuable insights we've shared. For today's #TuesdayTip, we're excited to take a moment to look back at the last 10 tips we've shared in case you missed any or want to revisit them. Thanks for your incredible support for this series--we're so glad it was able to help so many of you navigate your community experience!   Getting Started in the Community An overview of everything you need to know about navigating the community on one page!  Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Community Ranks and YOU Have you ever wondered how your fellow community members ascend the ranks within our community? We explain everything about ranks and how to achieve points so you can climb up in the rankings! Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Powering Up Your Community Profile Your Community User Profile is how the Community knows you--so it's essential that it works the way you need it to! From changing your username to updating contact information, this Knowledge Base Article is your best resource for powering up your profile. Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Community Blogs--A Great Place to Start There's so much you'll discover in the Community Blogs, and we hope you'll check them out today!  Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Unlocking Community Achievements and Earning Badges Across the Communities, you'll see badges on users profile that recognize and reward their engagement and contributions. Check out some details on Community badges--and find out more in the detailed link at the end of the article! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Blogging in the Community Interested in blogging? Everything you need to know on writing blogs in our four communities! Get started blogging across the Power Platform communities today! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Subscriptions & Notifications We don't want you to miss a thing in the community! Read all about how to subscribe to sections of our forums and how to setup your notifications! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Getting Started with Private Messages & Macros Do you want to enhance your communication in the Community and streamline your interactions? One of the best ways to do this is to ensure you are using Private Messaging--and the ever-handy macros that are available to you as a Community member! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Community User Groups Learn everything about being part of, starting, or leading a User Group in the Power Platform Community. Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Update Your Community Profile Today! Keep your community profile up to date which is essential for staying connected and engaged with the community. Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Thank you for being an integral part of our journey.   Here's to many more Tuesday Tips as we pave the way for a brighter, more connected future! As always, watch the News & Announcements for the next set of tips, coming soon!

Hear what's next for the Power Up Program

Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram, including a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the link below to sign up today! https://aka.ms/PowerUp  

Welcome to the Power Apps Community

Welcome! Congratulations on joining the Microsoft Power Apps community! You are now a part of a vibrant group of peers and industry experts who are here to network, share knowledge, and even have a little fun! Now that you are a member, you can enjoy the following resources:   The Microsoft Power Apps Community Forums If you are looking for support with any part of Microsoft Power Apps, our forums are the place to go. They are titled "Get Help with Microsoft Power Apps " and there you will find thousands of technical professionals with years of experience who are ready and eager to answer your questions. You now have the ability to post, reply and give "kudos" on the Power Apps community forums! Make sure you conduct a quick search before creating a new post because your question may have already been asked and answered!   Microsoft Power Apps IdeasDo you have an idea to improve the Microsoft Power Apps experience, or a feature request for future product updates? Then the "Power Apps Ideas" section is where you can contribute your suggestions and vote for ideas posted by other community members. We constantly look to the most voted Ideas when planning updates, so your suggestions and votes will always make a difference.   Community Blog & NewsOver the years, more than 600 Power Apps Community Blog Articles have been written and published by our thriving community. Our community members have learned some excellent tips and have keen insights on building Power Apps. On the Power Apps Community Blog, read the latest Power Apps related posts from our community blog authors around the world. Let us know if you would like to become an author and contribute your own writing — everything Power Apps related is welcome!   Power Apps Samples, Learning and Videos GalleriesOur galleries have a little bit of everything to do with Power Apps. Our galleries are great for finding inspiration for your next app or component. You can view, comment and kudo the apps and component gallery to see what others have created! Or share Power Apps that you have created with other Power Apps enthusiasts. Along with all of that awesome content, there is the Power Apps Community Video & MBAS gallery where you can watch tutorials and demos by Microsoft staff, partners, and community gurus in our community video gallery.   Again, we are excited to welcome you to the Microsoft Power Apps community family! Whether you are brand new to the world of process automation or you are a seasoned Power Apps veteran. Our goal is to shape the community to be your ‘go to’ for support, networking, education, inspiration and encouragement as we enjoy this adventure together!   Let us know in the Community Feedback if you have any questions or comments about your community experience.To learn more about the community and your account be sure to visit our Community Support Area boards to learn more! We look forward to seeing you in the Power Apps Community!The Power Apps Team

Top Solution Authors
Top Kudoed Authors
Users online (4,602)