Text calculated custom fields CONCAT separator options | Community
Skip to main content
August 26, 2022
Question

Text calculated custom fields CONCAT separator options

  • August 26, 2022
  • 5 replies
  • 5130 views

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"
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

5 replies

William--
Community Advisor
Community Advisor
August 27, 2022

To insert a line break into a valueexpression, insert the unicode character for newline as shown below. 
This example inserts a line break between the record's owner and the record owner's email address. 

CONCAT({owner}.{name},"\u000A",{owner}.{emailAddr})



(original comment edited to display the best solution above)

If you like my content, please take a moment to view and vote on my Idea Requests: https://tinyurl.com/4rbpr7hf
DanBlAuthor
September 1, 2022

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?

laurence_jayawardane
September 2, 2022

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.

William--
Community Advisor
Community Advisor
April 28, 2023

Notifying anyone following this thread that a discovery has been unearthed!

@skyehansen was sharing this trick by @the_real_melinda_layten in a larger discussion about multi-select fields. I then realized this is how we can insert unicode control characters into a value expression, without having to rely on the clunky workaround that was previously described. 

CONCAT({owner}.{name},"\u000A",{owner}.{emailAddr})

This makes it very easy to insert a line break in a calculated field or column, by simply putting in the unicode \u000A in your expression where a line break is needed.

Even more importantly, this can be used to replace column sharing in many, many situations. A single calculated column can replace multiple shared columns using this approach - and will also be easier to re-arrange within a view since there are no column number prefixes that have to be considered. 

If you like my content, please take a moment to view and vote on my Idea Requests: https://tinyurl.com/4rbpr7hf
Doug_Den_Hoed__AtAppStore
Community Advisor
Community Advisor
April 28, 2023

 

Thanks for sharing @william-- 

 

I'm going to use this new approach rather than column sharing going forward: it is lighter, more functional, and easier to maintain...provided I remember to always re-supply the extra leading \ symbols that are sacrificed whenever such calculations are edited via the front end (vs pushing such calcs in via the API).

 

Regards,

Doug

May 2, 2023

Hi All!
I want to know the escape character here, requirement is to keep the owner name and email address in quotes, how can we achieve it?

CONCAT("Name":"{owner}.{name}","'","Email":"{owner}.{emailAddr}")

 

Doug_Den_Hoed__AtAppStore
Community Advisor
Community Advisor
May 2, 2023


Hi @neetukanwarmokawat,

 

One way is to use ‘ for the concat components, and “ for the delimiters around the contained terms, like this;

 

CONCAT(‘“Name”:”’,{owner}.{name},””’,…)

 

Regards,

Doug