Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit is happening now. Discover what's next in customer experience.

Text calculated custom fields CONCAT separator options

Avatar

Level 1

I see these examples listed here. But is there a more complete list? Specifically a way to force a line break between fields? Especially blank fieds?

 

CONCAT

This expression concatenates the string and is formatted as follows:

CONCAT(string1,"separator", string2)

The following are examples of separators that you can include:

  • a space: " "
  • a dash: "-"
  • a slash: "/"
  • a comma: ","
  • a word: "or", "and"
8 Replies

Avatar

Community Advisor

Sorry to inform you that there is no separator that can insert a line break between strings in a CONCAT expression. 


The article you pasted from could be better worded. There is no official "list" of supported separators - the separator is simply whatever characters you put between the quotations. " " and " - " and "/" and "," and "or" are all functionally the same. You can insert just about any character between the quotations to use as a separator - even emoji. It's simply a matter of what character(s) you prefer to display to separate strings.

 

The reason line breaks don't work is that they're a control character, as are tab, backspace, ctrl, and alt. Although calculated fields can contain line breaks, the CONCAT expression in Workfront doesn't allow for a way to insert control characters such as line break as a separator.

Avatar

Level 1

Thanks. Conceivably, I could work around by adding a line break to the calculated field between CONCAT expressions? What's the line break character that calculated fields can read?

Avatar

Level 3

I don't know the answer to your specific question Dan, but I do simply use an extra column that I share (sharecol=true) that has the separator there, in some instances. For example merging a name and a description and adding a line in between... I'd add two columns, one for name, one for description, then use the method here to add a third column under the subheader "Merge data from two columns with a line break" to then merge the two initial columns together. Except instead of using value=<br> I'd use value=<hr> for a horizontal line.

Avatar

Community Advisor

To my knowledge, it's not just the CONCAT operator that doesn't accept line breaks, there's no operator that enables the insertion of a line break into a calculated expression. 

The only way in which calculated fields end up containing line breaks is when the expression that writes the calculated value references a text field whose value already contains line breaks. E.g., consider a simple expression that is just CONCAT({description}) on a calculated field called DE:Calculated Description. Since the description field of an object allows the user to enter line breaks, any calculated expression that references description will honor the line breaks in that field when it copies the text to DE:Calculated Description.

With that in mind, one could:
1. Create a custom text paragraph field called DE:Line Break and add this field to a custom form that is attached to the instance's primary Company.
2. Edit the Company's custom form, and in the DE:Line Break paragraph field, enter some invisible unicode like 200B 000A 200B (zero width space, line break, zero width space).
3. In the CONCAT expression on the field in which you need to insert line breaks, reference {company}.{DE:Line Break} between the strings that require a line break.

I have tested this approach and it works, albeit clunky. 

The intent of adding the DE:Line Break paragraph field to the Company object, as opposed to a project/task/issue object, is it allows you to centrally manage the field and ensure it has the correct unicode values. Users don't even know it exists much less have the ability to overwrite it, and admins only have one place they need to manage it.

I don't know why I hadn't thought of this before, thanks for the challenge!
-WE

Avatar

Level 10


Brilliant @William--

 

Thanks for sharing: it’s in the vault!

 

Regards,

Doug

Avatar

Level 3

I was referred to this thread last week by a colleague, and it seems like it would solve an issue we have worked around for some time. 

I have a question about Step 2 though - how would I go about "entering" the invisible unicode into the custom paragraph field? Pasting in the text "200B 000A 200B" causes those characters to be rendered into the new string. Is there an text entry method for unicode that will keep it invisible?

Thank you!

Avatar

Level 3

Got it working. Very creative solution! Thank you!

Avatar

Community Advisor

For anyone else referencing this in the future, you'll need to look for a unicode reference website to look for those particular unicode characters, copy them from that site, then paste into your calculation. 

Since they're invisible, it doesn't do much good to paste them in this thread. 

 

https://unicode-table.com/en/200B/

https://unicode-table.com/en/000A/