Hi Champ,
I have a map variable and the same is used in the table. So I can see it was coded as todatasubset to the map variable with a local defined pagination variable. It's working fine if the map is having less no of rows then pagination ;but getting errorrdout when it's having more rows..message says like "batc size was 0 but te largest column data array had 12 items."
So FYI: We are not using datasubset rather using todatasubset.
Regards,
Ghanashyam
Discussion posts and replies are publicly visible
Please find the error screenshot along with the code snippet
I just put some portion of the code needed to debug this
a!localVariables( local!paginInfo:a!pagingInfo( startindex: 1, batchSize: 10 ), local!mapDataSubset: a!dataSubset( startIndex:local!paginInfo.startIndex, batchSize:local!paginInfo.batchSize, totalCount:count(index(ri!map,"abc",{})), sort:a!sortInfo( field:"abc", ascending:true ), data:ri!map, identifiers:index(ri!map,"abc",{}) ), a!gridField( label: "label", labelPosition: "ABOVE", data: local!mapDataSubset, pagingSaveInto:local!paginInfo )
When creating a data subset using a!datasubset(), you have to make sure that the number of items in "data" matches the batchsize parameter.
As I am having pagination in my grid..how can I make it data to be changed dynamically based on pagination?
Your batchsize is greater than the number of rows that are available. Lets say you have 10 rows in the 1st page you are trying to fetch another 10 i.e 11-20 rows which are not available in the data.
Use todatasubset().
I can but the code already written earlier..and if I change that..lot of other changes needed as with todatasubset() , I am unable to play with the identifiers and it's taking like 1,2,3 automatically instead of real primaryley or the the id that I need..becaused based on the selected row many other functionalities already being designed..So thinking is there any way to do with current coding only by using a!datasubset()
It's vice-versa..actually ..batch size is 10 ; but the total data is 12
Well ... sure, just pick the first n items to put into the data.
Is there any easier way to get a range in appian for an array?
Is there any easy way to get an range in array in appian
ghanashyamm0005 said:Is there any easy way to get an range in array
again - todatasubset() does this for you. a!dataSubset() does not.