I solved it myself. I don't know why I need to write this though.
{
"$schema": "~~~",
"elmType": "div",
"children": [
{
"forEach": "Iterator in split([$Content],'//')",
"elmType": "div",
"txtContent": "a"
}
]
}
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
In the JSON formatting of SharePoint lists, the "forEach" using arrays does not work properly, and the output result becomes blank.
The following is a code sample that does not work properly.
It is really frustrating even though it is a simple thing.
(Output Example)
When the value of the $Content column is "AA//BB//CC", the desired output result is "aaa".
{
"$schema": "~~~",
"elmType": "div",
"forEach": "Iterator in split([$Content],'//')",
"txtContent": "a"
}
I solved it myself. I don't know why I need to write this though.
{
"$schema": "~~~",
"elmType": "div",
"children": [
{
"forEach": "Iterator in split([$Content],'//')",
"elmType": "div",
"txtContent": "a"
}
]
}
Hi @FUJISHIGE,Shuto/藤重 秀斗 ,
Great to know that and thanks for sharing the update here.
By the way, since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others.". and according to the scenario introduced here: Answering your own questions on Microsoft Q&A, I would make a brief summary of this thread:
[How to set up "forEach" syntax using arrays.]
Issue Symptom:
In the JSON formatting of SharePoint lists, the "forEach" using arrays does not work properly, and the output result becomes blank.
The following is a code sample that does not work properly.
It is really frustrating even though it is a simple thing.
(Output Example)
When the value of the $Content column is "AA//BB//CC", the desired output result is "aaa".
{
"$schema": "~~~",
"elmType": "div",
"forEach": "Iterator in split([$Content],'//')",
"txtContent": "a"
}
Current status:
I solved it myself. I don't know why I need to write this though.
{
"$schema": "~~~",
"elmType": "div",
"children": [
{
"forEach": "Iterator in split([$Content],'//')",
"elmType": "div",
"txtContent": "a"
}
]
}
You could click the "Accept Answer" button for this summary to close this thread, and this can make it easier for other community members to see the useful information when reading this thread. Thanks for your understanding!
Have a nice day! :-)