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

How do I create a custom entity with a "full name" primary field concatenated from first and last names?

I am new to CDS & powerapps, so please forgive my ignorance.

 

I am creating a database which has a Salespeople entity, similar to the Contacts entitiy. Contacts are already in place by default, but I need a "fullname" primary field for the Salespeople entity, just like the default Contacts...

 

How would I accomplish this?

thanks so much!

1 ACCEPTED SOLUTION

Accepted Solutions

Re: How do I create a custom entity with a "full name" primary field concatenated from first and last names?

Unfortunately there is no way to duplicate the functionality of the contact entity into a new custom entity. Other options are:

  • If you don't use the lead entity, you could repurpose that entity, as the primary field is fullname. However, this would prevent you from using the lead entity for it's normal purpose
  • Create a custom entity, and the name field as the primary field, and separate fields for first and last name. Create a real-time workflow (on Create, and Update of the first or last name fields) to populate the name field from the first and last name. The advantage of doing this rather than a calculated field is that you are populating the primary field

View solution in original post

12 REPLIES 12
Super User
Super User

Re: How do I create a custom entity with a "full name" primary field concatenated from first and last names?

Hi @Madumi 

I have been trying to do the same with a custom entity without luck.  The closest I came was to use the Last name field as the Primary Name field and create a calculated field for the full name by concatenating the first and last names.  As far as I can tell, you can't use a calculated field as a primary name field.   

Madumi
Level: Powered On

Re: How do I create a custom entity with a "full name" primary field concatenated from first and last names?

thanks @Drrickryp 

 

Hmmm, that would be a pity indeed if it wasn't possible to do that.

 

Alternatively, can anyone think of a way to duplicate a current Entity (eg. "Contacts") with it's properties (maybe export & re-import somehow). Even if I could create a "Contacts 2" entity (with the "fullname" field, concatenated from first name and last name as a primary field), that would serve my purposes just as well...

Re: How do I create a custom entity with a "full name" primary field concatenated from first and last names?

Unfortunately there is no way to duplicate the functionality of the contact entity into a new custom entity. Other options are:

  • If you don't use the lead entity, you could repurpose that entity, as the primary field is fullname. However, this would prevent you from using the lead entity for it's normal purpose
  • Create a custom entity, and the name field as the primary field, and separate fields for first and last name. Create a real-time workflow (on Create, and Update of the first or last name fields) to populate the name field from the first and last name. The advantage of doing this rather than a calculated field is that you are populating the primary field

View solution in original post

Community Support Team
Community Support Team

Re: How do I create a custom entity with a "full name" primary field concatenated from first and last names?

Hi @Madumi ,

Do you want to create a Primary column "Full Name" within your Salespeople entity to act as the "Full Name" column in Contacts Entity (concatenated with First Name column and Last Name column)?

 

Based on the needs that you mentioned, I afraid that there is no way to achieve your needs in PowerApps currently. I agree with @DavidJennaway 's thought almost. You could consider create separated First Name field and Last Name field in your Salespeople entity (mark the two field as Required), and then rename the "Primary Name" field in your Salespeople entity into "Full Name".

When you create a new record in your Salespeople entity, you could consider design a Workflow to concatenate the "First Name" field value and "Last Name" field value, then populate the concatenated string value into the "Full Name" field.

 

If you generate a PowerApps app based on your Salespeople entity, and want to use PowerApps app to enter new record into your Salespeople entity, you could consider go to the Edit screen, then select the Edit form, then unlock the "Full Name" data card i your Edit form, set the Default property of the "Full Name" Text Input Box to following:

FirstNameTextBox.Text & " " & LastNameTextBox.Text

 then when you enter first name and last name within your form, the "Full Name" field would be populated with the concatenated value automatically.

 

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.
Madumi
Level: Powered On

Re: How do I create a custom entity with a "full name" primary field concatenated from first and last names?

Thanks so much @v-xida-msft,

 

Where would I create a workflow like that? Is is a power automate (flow.microsoft.com)? or where?

 

Thanks also for the default property suggestion for a powerapp. That would overwrite the value for Full Name each time data was changed or entered in either First Name or Last Name right?

 

thx!

Madumi
Level: Powered On

Re: How do I create a custom entity with a "full name" primary field concatenated from first and last names?

OK, I am currently trying to use Flows to update the primary field "Full Name" using the "First Name" and "Last Name" fields.

Sadly, I cant seem to find a way to trigger this operation, because the primary field is a required field. i.e. it cannot be saved/updated without content already present in the field.

 

I can see a way to do this within a powerapp form... However, is there a way to do this & populate the "Full Name" primary field using Flows and within the Salesperson CDS table itself?

 

Thanks!

Re: How do I create a custom entity with a "full name" primary field concatenated from first and last names?

Flow (Power Automate) is used for asynchronous operations. I'd recommend a synchronous workflow to set the fullname, which you can create in CDS.

You can also change the requirement level of the primary field. It is mandatory by default, but this can be changed

Madumi
Level: Powered On

Re: How do I create a custom entity with a "full name" primary field concatenated from first and last names?

Thanks so much @DavidJennaway 

 

I'm just getting my feet wet here with CDS & powerapps...  Synchronous sounds good. Where would I achieve this (any hints on where I should be clicking/building)?

Madumi
Level: Powered On

Re: How do I create a custom entity with a "full name" primary field concatenated from first and last names?

@DavidJennaway 

 

Thanks again for your suggestions. I can see a way to concatenate fields synchronously in CDS-->Flows-->New (instant, from blank). However if I am concatenating first, middle and last with a space between, it results in two spaces if the middle name is absent.

 

Do I need to use an expression (rather than dynamic content) to create the concatenation, & if so, how do I call an entity field (eg firstname) in the concat() expression? I can't seem to find the right way to call entity fields...

 

Thanks!

 

 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,386)