Closed benjblack closed 1 year ago
Hello @benjblack
Can you tell me what's the internal name of the column you used to test this sample?
I did a quick test and it didn't work when split operator is used to create an array.
This is a weird bug where spaces are the problem. To see it in action, switch this line:
"forEach": "choiceIterator in split('hello world yo', ' ')",
To this one (no spaces at all in either the value or the expression after the in
"forEach": "choiceIterator in split('hello|world|yo','|')",
And you'll see things work. It isn't really supposed to work and the use of split
in a forEach
isn't technically the intended scenario. But it absolutely should.
I recommend opening this as an issue on the official issues list so that they can work on it there (this one is just for samples)
@thechriskent thanks for your precious support and clarification!
Sample
https://github.com/pnp/List-Formatting/tree/master/column-samples/multi-choice-foreach
What Should Happen
According to the documentation, forEach iterates over a multi-choice field or an array. ex., from the documentation: "iteratorName in Expression-Returning-An-Array"
So in multi-choice-foreach.json, I should be able to replace @currentField with:
That way, I could have a comma-delimited string in a text field, split it, and write display the different values, like so:
What Actually Happens
Nothing is rendered in the cell. Tested in SharePoint online in a modern site / modern list experience.