Here is the JSON data provided. I am interested in using information from 2ndCol, 3rdCol, and 4thCol columns within the rows.
{
"workflows":[
{
"New":{
"All":{
"sections":[
{
"id":"section_1",
"section":"",
"title":"SEPG Audit Checklist",
"rows":[
{
"id" : "0",
"label" : "How do you establish and maintain the description of the process needs and objectives for the organization?",
"2ndCol" : {
"type" : "select",
"source":[
{
"id":"Yes",
"value":"Yes"
},
{
"id":"No",
"value":"No"
},
{
"id":"N/A",
"value":"N/A"
}
],
"value":[],
"required":true,
"disabled":false,
"hidden":false
},
"3rdCol" : {
"type" : "select",
"source":[
{
"id":"Yes",
"value":"Yes"
},
{
"id":"No",
"value":"No"
}
],
"value":[],
"required":true,
"disabled":false,
"hidden":false
},
"4thCol" : {
"type" : "textarea",
"label": "Comments",
"PlaceHolder":"Enter Comment",
"Value":""
}
},
{
"id" : "1",
"label" : "Explain Organizational process performance objectives?",
"2ndCol" : {
"type" : "select",
"source":[
... (remaining content has been omitted for brevity)
I have successfully accessed the id and label properties from the rows. However, when attempting to access the 2ndCol, 3rdCol, and 4thCol values within the rows, an illegal argument error occurs.
Upon inspecting my angular controller:
angular.forEach($scope.auditJSON.workflows, function(workflow, workflowIndex) {
angular.forEach(workflow, function(workflowValue, workflowKey) {
angular.forEach(workflowValue, function(value, roleKey) {
angular.forEach(value.sections, function(section, sectionIndx) {
angular.forEach(section.rows, function(row, rowIndx) {
console.log(row.label); // This works fine
console.log(row.2ndCol.type); // Error occurs here
});
});
});
});
});
I am currently facing challenges in resolving this issue.