6

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.

6

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

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

Output (example):

8 hour(s)

  • 1
    Great answer, I'd also add that you can do this online with a single line like this: "txtContent": "=[$Duration] + ' ' + [$DurationUnits]" Also, worth mentioning is that unlike in calculated columns, both of these fields need to be present in the view in order to access their values using list formatting. – theChrisKent Jun 7 at 13:20
0

No OOB function like concat string(other than '+') in JSON format based official document here.

Other solution would be using SharePoint workflow or Microsoft Flow.enter image description here

  • This lacks any detail whatsoever for the original question. See my answer. – James Love May 16 at 12:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.