Hi Smart People!
I'm using the standard pattern to create a grid interface from the process task report (Creating a user task queue to process tasks) and am running into the following error:
Cannot index "columnConfigs" because it is an array type (List of Variant). Only fields with scalar types can be indexed from an array.
I've created the most basic Process Task Report, then used the a!QueryProcessAnalytics to pull this into my interface. The data looks correct, but when I create the grid (using the patterns from designer, and also several examples from the documentation), I get the same error.
When I compare the data from my report, it displays as "List of Dictionary". But when I look at the sample data from the pattern, it displays as a "List of Map" (this was just hardcoded into a local variable). See the attached screenshots. This is the only difference I can see in the data subsets
Any ideas??
Here are the relevant code snippets.
a!queryProcessAnalytics( report: cons!CVC_TASK_REPORT, query: a!query( pagingInfo: a!pagingInfo( startIndex: 1, batchSize: -1, sort: a!sortInfo( field: "c2", ascending: false ) ), filter: a!queryFilter( field: "c5", operator: "in", value: local!statusFilter, applyWhen: a!isNotNullOrEmpty(local!statusFilter) ) ) )
a!gridField( label: local!taskReportData.name, instructions: "test instructions", data: local!taskReportData, columns: a!forEach( items: local!taskReportData.columnConfigs, expression: a!gridColumn( label: fv!item.label, sortField: fv!item.field, value: if( fv!item.configuredFormatting = "TASK_STATUS", index( { "Assigned", ........
Discussion posts and replies are publicly visible
The query result has two parts .data(rows) and .columnConfigs (column metadata). Access them separately, don't try to get columnConfigs from the data array.Sample Code for reference
local!taskReportResult: a!queryProcessAnalytics( report: cons!YOUR_TASK_REPORT, query: a!query( pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 50) ) ), a!gridField( data: local!taskReportResult.data, /* Use .data for rows */ columns: a!forEach( items: local!taskReportResult.columnConfigs, /* Use .columnConfigs separately */ expression: a!gridColumn( label: fv!item.label, sortField: fv!item.field, value: index(fv!row, fv!item.field, null) ) ) )