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.

有帮助吗?

解决方案

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)

许可以下: CC-BY-SA归因
scroll top