106290 - no subject - Hi,\nPlease find below the code snippet.

Hi,
Please find below the code snippet.

a!gridTextColumn(
label: "Active",
data: if(
isnull(
local!data.isActive
),
"",
index(
local!data,
"isActive",
{}
)
),
field: "isActive"
)

Error:
Invalid index: Cannot index property 'isActive' of type Text into null value of type List of Variant.

How can I fix this issue? Any inputs are highly appreciated....

OriginalPostID-106290

  Discussion posts and replies are publicly visible

Parents
  • Hi phanibabuk, Few things to note here are:
    1. As you are using index(), there is no need for explicit null handling. index(local!data,"isActive",{}) will do it for you.
    2. The error which you are seeing might be the outcome of two possible reasons as following:
    a. Your code renders single null ("") if local!data.isActive is null. You are trying to assign a single null value to multiple type field.
    b. The field 'isActive' might not exist with the same name. Cross check the cdt once.
Reply
  • Hi phanibabuk, Few things to note here are:
    1. As you are using index(), there is no need for explicit null handling. index(local!data,"isActive",{}) will do it for you.
    2. The error which you are seeing might be the outcome of two possible reasons as following:
    a. Your code renders single null ("") if local!data.isActive is null. You are trying to assign a single null value to multiple type field.
    b. The field 'isActive' might not exist with the same name. Cross check the cdt once.
Children
No Data