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) ) ) )
1) My guess is that Shubham is right and that you've defined your "local!taskReportData" to reference the ".data" parameter of the query output, which of course would cause the local variable to not even contain the "columnConfigs" output. Though it's hard to tell exactly since you don't include the full definition of your local variable for us to check.
2) please, i'm begging you:
3) in general, I don't even bother with the "colunm configs" like this to define my report outputs - not because it's not possible, but because I prefer to cherrypick which columns I bother to show, plus I prefer to manually code the display style for each individual column, and provide specific names (that will usually differ from the report's naming convention). To do this you just manually declare the columns you want to reference on your grid.