Skip to main content
May 7, 2023
Question

can only be indexed into using square brackets or the index function

  • May 7, 2023
  • 4 replies
  • 0 views

Hi,

I am new to Appian and I am trying using a rule object as grid data source. but getting below error 

Could not display interface. Please check definition and inputs. Interface Definition: Expression evaluation error at function a!gridField [line 2]: A grid component [label="Read-only Grid"] has an invalid value for "columns". A grid column [label="Vehicleid"] has encountered an error. Expression evaluation error: AX TestVehicle can only be indexed into using square brackets or the index function

This is written in the interface 

{
a!gridField(
label: "Read-only Grid",
labelPosition: "ABOVE",
data: rule!AX_SearchVehicles(),
columns: {
a!gridColumn(
label: "Vehicleid",
sortField: "vehicleid",
value: fv!row.vehicleid
),
a!gridColumn(
label: "Vehiclemake",
sortField: "vehiclemake",
value: fv!row.vehiclemake
),
a!gridColumn(
label: "Vehiclemodel",
sortField: "vehiclemodel",
value: fv!row.vehiclemodel
),
a!gridColumn(
label: "Vehiclecolor",
sortField: "vehiclecolor",
value: fv!row.vehiclecolor
),
a!gridColumn(
label: "Vehiclecondition",
sortField: "vehiclecondition",
value: fv!row.vehiclecondition
),
a!gridColumn(
label: "Vehiclestatus",
sortField: "vehiclestatus",
value: fv!row.vehiclestatus
),
a!gridColumn(
label: "Vehiclecategory",
sortField: "vehiclecategory",
value: fv!row.vehiclecategory
)
},
validations: {}
)
}

------------------------------------------

This is what written behind AX_SearchVehicles()

a!queryRecordType(
recordType: 'recordType!{ae12c912-bb55-4de6-b097-819e20ae55ee}AX TestVehicle',
fields: {
'recordType!AX TestVehicle.fields.vehicleid',
'recordType!AX TestVehicle.fields.vehiclemake',
'recordType!AX TestVehicle.fields.vehiclemodel',
'recordType!AX TestVehicle.fields.vehiclecolor',
'recordType!AX TestVehicle.fields.vehiclecondition',
'recordType!AX TestVehicle.fields.vehiclestatus',
'recordType!AX TestVehicle.fields.vehiclecategory'
},


pagingInfo: a!pagingInfo(
startIndex: 1,
batchSize: 100
)
).data

4 replies

mallepup3914
May 7, 2023

Instead of .data use index() function to filter data with index 

pragnaj0001
May 7, 2023

grid data source is from record (record type) we should use fv!row[recordType!Case.fields.caseName]. if it is data base we use fv!row.field. 

stefanhelzle0001
Brainy
May 8, 2023
harshitb6843
May 8, 2023

I think your title tells you the solution. Is there any other problem you are facing? 

While working with records, you can only use [] or index() to access a child property (column name in your case) as the column names are not the keys here but rather some reference that Appian uses.