1

I have a column "Action Status" which is looking up multiple values in a separate Actions table.

The first screen shot shows how the data appears without applying any JSON coding (I'm a complete novice with this) and the second what it looks like when I've used one of the suggested codes (online) to wrap the text after ";".

The problem is that some of the returned values are blank and appear as "; ;" in my list and therefore when the wrap coding is applied it leaves a blank row for the empty values (see second screenshot).

How do I wrap after ";" AND delete the blank values please?

JSON code I've used:

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "div",
"txtContent": "=replaceAll(@currentField, '; ', '\n')"
}

Without JSON formatting:

enter image description here

With JSON formatting:

enter image description here

1
  • Try using expression for txtContent like: =replaceAll(replaceAll(@currentField, '; ; ', '; '), '; ', '\n'). Let me know if it works for you. Feb 26 at 12:35

1 Answer 1

0

Try using SharePoint JSON column formatting like:

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "txtContent": "=replaceAll(replaceAll(@currentField, '; ; ', '; '), '; ', '\n')"
}

References:

  1. SharePoint: Replace All Occurrences of Substring in a String using JSON Formatting
  2. Wrap text in a column after a character (;) using JSON
  3. Use column formatting to customize SharePoint
3
  • 1
    Amazing! Thank you, that works
    – user111397
    Feb 26 at 13:14
  • Great, I am glad it worked for you. Feb 26 at 13:17
  • Please accept my above response as an Answer as it helped you & it will help others with similar question in future to find the correct answer easily. Keep using this platform for asking any questions related to SharePoint, thank you! Feb 26 at 13:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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