count() and length() is not working with related record

I have a parent record case details which is having a one to many relationship with another record task details. When the data of caseDetails is loaded on first load of interface in rule input or local variable either using query record or process model, then I'm using count() or length() function to count no. of items in related record "task details" which is populating in relationship of caseDetails in same rule input or local variable.

Count or length both are returning count as 1 only. But, if I make any changes in loaded tasks list and it's updated on any user action then count is showing correct count of items in that relationship.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    Hi,

    Force a Refresh

    Query Entity:

    When using a!queryEntity to load data, add a new parameter a!refreshVariable() as input to force Appian to fetch new data.


    Process model:

     If the data comes from a process model, use the "Refresh Variable" option in the relevant node's properties.


    Save the Parent:

    Trigger a save of the parent record after any changes to the related records. This updates the parent's data and should invalidate the cache

    Example of a!queryEntity:

    Code: 

    a!queryEntity(

    entity: cons!Your_Parent_Record_CDT,

    consolidated: true,

    identifiers: a!pagingInfo(),

    a!refreshVariable() // Force a fresh fetch of related records

    )

  • I tried forcing refresh as well but still the issue is same.

Reply Children
No Data