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.
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()
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.
Now I am doing something as below and it's working now
The change is in data and indentifier parameter in a!datasubset()
it seems like you're doing a lot of work to manually recreate the output you'd get automatically just from calling todatasubset() on the original data set and paging info. I guess I'm unclear why.
The reason is..the code is already written and there are other changes I need to do if I change that to todatasubset(), because I can't set the identifiers by my own and it's taking the id automatically like 1,2,3. That will make lot of code change again. So I was thinking of a minimal code change but no major testing needed.Hope that makes sense.
You could try updating just the identifiers parameter of the datasubset with the identifiers for the current page via a!update().