For my datasubset, why is totalCount=1 when data appears null (but Appian says it's a List of Variant)?

I'm having an issue where I've got an empty load variable which is being set to a datasubset for use in a paging grid. Instead of the totalCount=0 and data=null, it's giving me a totalCount=1 and a data=List of Variant (I had to use a typename(typeof(data)) to find out) and it makes no sense to me.

 

Could you please share with me what is causing this to happen and what the fix is?

  Discussion posts and replies are publicly visible

Parents
  • +1
    Certified Lead Developer

    Hi jeromew,

    Try defining the local variable as below

    local!data: {} 

    Also, todatasubset behaves as below
    
    todatasubset(null, a!pagingInfo(1,10)) returns [startIndex=1, batchSize=10, sort=, totalCount=1, data=, identifiers=1]
    todatasubset({}, a!pagingInfo(1,10)) return [startIndex=1, batchSize=10, sort=, totalCount=0, data=, identifiers=]
    
    
      

    Good to do the below while doing todatasubset in your case,
    
    todatasubset(if(rule!checkNullOrEmpty(local!data), {}, local!data), a!pagingInfo(1,10)) 

Reply
  • +1
    Certified Lead Developer

    Hi jeromew,

    Try defining the local variable as below

    local!data: {} 

    Also, todatasubset behaves as below
    
    todatasubset(null, a!pagingInfo(1,10)) returns [startIndex=1, batchSize=10, sort=, totalCount=1, data=, identifiers=1]
    todatasubset({}, a!pagingInfo(1,10)) return [startIndex=1, batchSize=10, sort=, totalCount=0, data=, identifiers=]
    
    
      

    Good to do the below while doing todatasubset in your case,
    
    todatasubset(if(rule!checkNullOrEmpty(local!data), {}, local!data), a!pagingInfo(1,10)) 

Children