Hello,
I am using a!gridField() with 'data' as datasubset, 'columns' , 'pagingSaveInto' and 'emptyGridMessage' defined into it. Data comes in chunks from the external end point (using API).
My page contains filter section and grid section. First time when page loads it all works fin. Issue comes when I change the gird to next page(s) and then after I add a filter criteria into it in such a way that I do not find any record ( i.e. no data items to show after filter ) and hit "apply" button. Error comes like below:
"Expression evaluation error in rule 'xxx' at function a!gridField: A grid component [label=“”] has an invalid value for “value” and “totalCount”. “startIndex” must not be greater than “totalCount”, but “startIndex” was 21 and “totalCount” was 0."
"All variables" of the "grid field interface" are the rule inputs (ri! variables) and its values are getting updated in apply button's saveinto event. However the gridField is still using the old pagination values and throws error.
This rule is already inside the with() block.
Discussion posts and replies are publicly visible
Hii,
On the filter saveInto, please reset the startindex to 1, it will solve your issue.
Thanks
Be sure you have included the datasubset inside with() block, your startIndex is set to 1 and at the end of the grid you have the following config:
value: local!pagingInfo, saveInto: local!pagingInfo,
You can go through the tutorial and look at the samples.
https://docs.appian.com/suite/help/19.3/Paging_Grid_Component_191.html
Hello Vinay, Thanks for reply.
I have already set startindex to 1 into Filter Apply button's save-into block. it holds start index 1. Still showing the error.
Thanks Dimitris.
The new gridField() don't have the "value" parameter, that is the reason we are not able to re-set it as value: local!pagingInfo
The old version a!gridField_19r1() had the value parameter, but the new version don't have it.
You said that you have a with() block.
Check the Manual Paging section on the following link:
https://docs.appian.com/suite/help/19.3/read-only-grid-configuration.html#manual-paging
Also, here is an ideal recipe for filtering data in a grid:
https://docs.appian.com/suite/help/19.3/recipe-filter-the-data-in-a-grid.html
Yes, all is set like this as required. However I tried few hacks and I got the issue and resolved it , Thanks for help.
Earlier: grid field's data was set as below which was showing error:
data: if(ri!tasklist_ds.totalCount=0,null,ri!tasklist_ds),
Now: removing the if condition in "data" parameter solved my issue.
data:ri!tasklist_ds,
Thanks for Help.