0

I have a SharePoint Lookup column with multiple choices, as follows:

Apple
Orange
Strawberry
Watermelon

How can I populate a different column by separating the choices with "X", as follows:

Apple X Orange X Strawberry

OR

Strawberry X Watermelon

1
1

Here is a sample of JSON formatting for multi-choice column to produce the expected result.

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "style": {
    "display": "block"
  },
  "children": [
    {
      "elmType": "span",
      "forEach": "fruit in @currentField",
      "txtContent": {
        "operator": "?",
        "operands": [
          "=loopIndex('fruit') == 0",
          "[$fruit.lookupValue]",
          "=' X ' + [$fruit.lookupValue]"
        ]
      }
    }
  ]
}

enter image description here

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.