cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kesh
Advocate III
Advocate III

Business rules concanenate

Hi,

I would like to create a business rule that will fill the "Name" field of a custom entity.

 

The field "name" will  be a concatenation of 3 fields:

- Field "User.'Full name'

- Field "Year"

- Field "Week_Number"

 

Can someone help me to build this business rule?

 

Kind regards

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @Kesh ,

Do you want to create a Business Rule for your custom Entity to fill "Name" field with concatenated three fields value?

 

If you want to create a Business Rule for your custom Entity to fill "Name" field with concatenated three fields value, I afraid that there is no way to achieve your needs in PowerApps currently.

 

Within Business Rule, there is no function or operator supported to concatenate multiple fields value for one field in CDS Entity.

 

As an simple solution, I also think the Calculation field functionality could achieve your needs. You could also consider remove the "Name" field from your CDS Entity, then configure it as a "Calculation" field as below:

2.JPG

More details about the Calculation field in CDS Entity, please check the following article:

https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/customize/types-of-field... 

Then you could use the CONCAT function to concatenate multiple field values (including LookUp field value) as below:

3.JPG

Within the expression box, type the following formula:

CONCAT(name, "-" ,accountnumber, "-", primarycontactid.fullname)

on your side, you should type following:

CONCAT(user.fullname, "-" , year, "-" , week_number)

Please consider take a try with above solution, then check if the issue is solved.

 

In addition, I also think the the Workflow functionality could achieve your needs. Please check and see if the following blog could help in your scenario:

https://powerplatformramblingsbystevenblog.com/2012/05/22/how-to-concatenate-two-fields-using-workfl...

 

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.

View solution in original post

3 REPLIES 3
v-xida-msft
Community Support
Community Support

Hi @Kesh ,

Do you want to create a Business Rule for your custom Entity to fill "Name" field with concatenated three fields value?

 

If you want to create a Business Rule for your custom Entity to fill "Name" field with concatenated three fields value, I afraid that there is no way to achieve your needs in PowerApps currently.

 

Within Business Rule, there is no function or operator supported to concatenate multiple fields value for one field in CDS Entity.

 

As an simple solution, I also think the Calculation field functionality could achieve your needs. You could also consider remove the "Name" field from your CDS Entity, then configure it as a "Calculation" field as below:

2.JPG

More details about the Calculation field in CDS Entity, please check the following article:

https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/customize/types-of-field... 

Then you could use the CONCAT function to concatenate multiple field values (including LookUp field value) as below:

3.JPG

Within the expression box, type the following formula:

CONCAT(name, "-" ,accountnumber, "-", primarycontactid.fullname)

on your side, you should type following:

CONCAT(user.fullname, "-" , year, "-" , week_number)

Please consider take a try with above solution, then check if the issue is solved.

 

In addition, I also think the the Workflow functionality could achieve your needs. Please check and see if the following blog could help in your scenario:

https://powerplatformramblingsbystevenblog.com/2012/05/22/how-to-concatenate-two-fields-using-workfl...

 

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.

Thank you very much!

eccountable
Advocate I
Advocate I

I have a better idea: how about the business rule calls an "Action" to do the calculation or concatenation. I proposed that idea here: https://ideas.powerapps.com/d365community/idea/06e1c7bd-d795-4f33-ad31-062614ab6673

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Users online (2,889)