Question

Is there a different way to join/concatenate values from 2 single line columns into a 3rd column other than the way below?

{
    "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
    "elmType": "div",
    "txtContent": "=[$Text1] + ' and ' + [$Text2]"
}

I do not want to use a calculated column for this.

Columns are Text1, Text2 and Text3 is the one being formatted.

Was it helpful?

Solution

Yep, your alternative to an inline expression is this for concatenating values:

{
  "elmType": "div",
  "txtContent": {
    "operator": "+",
    "operands": [
      "[$Duration]",
      " ",
      "[$DurationUnits]"
    ]
  }
}

or also

{
    "elmType": "div",
    "txtContent": "=[$Duration] + ' ' + [$DurationUnits]"
}

Output (example):

8 hour(s)

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top