Invalid index: Cannot index property 'asDate' of type Text into null value of type. How to solve that?

a!localVariables(
local!data: a!localVariables(
local!dateList: todate(
union(
index(ri!taskProductionList, "asDate"),
index(ri!taskProductionList, "asDate")
)
),
a!forEach(
local!dateList,
a!localVariables(
local!dateData: index(
ri!taskProductionList,
wherecontains(
fv!item,
todate(
index(ri!taskProductionList, "asDate", {})
)
),
{}
),
local!taskProduction: if(
and(rule!INO_isBlank(local!dateData)),
"-",
(
(
todecimal(local!dateData.taskId) / todecimal(local!dateData.taskDuration)
) * 100
),

),
if(
rule!INO_isBlank(local!dateData),
{
taskId: 0,
taskProduction: 0,
taskName: "-",
asDate: "-"
},
{
asDate: fv!item,
taskId: if(rule!INO_isBlank(local!dateData.taskId),0,local!dateData.taskId),
taskName: if(rule!INO_isBlank(local!dateData.taskName),0,local!dateData.taskName),
taskProduction: local!taskProduction,

}
)
)
)
),
{
a!richTextDisplayField(
labelPosition: "COLLAPSED",
value: a!richTextItem(
text: "Selected Task: " & ri!selectedGroup,
size: "MEDIUM",
color: "SECONDARY"
)
),
a!richTextDisplayField(
labelPosition: "COLLAPSED",
value: {
a!richTextIcon(
icon: "arrow-circle-left",
color: "ACCENT",
link: a!dynamicLink(value: null, saveInto: ri!selectedGroup),
linkStyle: "STANDALONE"
),
a!richTextItem(
text: " Back",
color: "ACCENT",
link: a!dynamicLink(value: null, saveInto: ri!selectedGroup),
linkStyle: "STANDALONE"
),

}
),
a!gridField(
labelPosition: "COLLAPSED",
borderStyle: "LIGHT",
initialSorts: { a!sortInfo(field: "asDate") },
data: local!data,
columns: {
a!gridColumn(
label: "Event Date",
sortField: "asDate",
value: a!richTextDisplayField(
value: a!richTextItem(text: fv!row.asDate)
)
),
a!gridColumn(
label: "Count of Tasks",
sortField: "taskId",
align: "END",
value: fv!row.taskId
),
/*a!gridColumn(
label: "Production Rate (tasks/hour)",
sortField: "taskProduction",
align: "END",
value: fixed(fv!row.taskProduction, 2, true)
)*/
}
),
/*a!textField(value:ri!taskProductionList ),
a!textField(value: todate(
union(
index(ri!taskProductionList, "asDate"),
index(ri!taskProductionList, "asDate")
)
) )*/
}
)

  Discussion posts and replies are publicly visible

Parents Reply Children