I have this as my source JSON:
[{
"project_name": "Video 12",
"project_type": "Video Caption",
"job_name": "Video 1",
"tasks": [{
"job_id": 1,
"task_id": 4,
"task_name": "Caption Video",
"contractor_name": "Fred Flintsone",
"location": null
}]
}, {
"project_name": "Very First Project",
"project_type": "Video Caption",
"job_name": "Some Job Name",
"tasks": null
}]
Now take this Text component:
**{{source.value[1].job_name}}**
Contractor: {{source.value[1].tasks[0].contractor_name}}
Project: {{source.value[1].project_name}}
Job Type: {{source.value[1].project_type}}
tasks.contractor_name
does not exist because there is no tasks
record in the second element, so that entry remains blank but the component is displaying the rest of the data:
Now let's say we take that same Text component and put it into a ListView (change the element reference to i
of course):
**{{source.value[i].job_name}}**
Contractor: {{source.value[i].tasks[0].contractor_name}}
Project: {{source.value[i].project_name}}
Job Type: {{source.value[i].project_type}}
We get this as the output:
Notice how that second element is simply blank? The entire component fails to display if there is an error in its Value.
Put a tasks.contractor_name
in there:
[{
"project_name": "Video 12",
"project_type": "Video Caption",
"job_name": "Video 1",
"tasks": [{
"job_id": 1,
"task_id": 4,
"task_name": "Caption Video",
"contractor_name": "Fred Flintsone",
"location": null
}]
}, {
"project_name": "Very First Project",
"project_type": "Video Caption",
"job_name": "Some Job Name",
"tasks": [{
"job_id": 1,
"task_id": 4,
"task_name": "Caption Video",
"contractor_name": "Fred Flintsone",
"location": null
}]
}]
And all is good:
Here is a JSON of an app that demos the problem: Dropbox - ListViewBug.json - Simplify your life