For Each Issue

Hi ,

local!lastRowDetails: a!forEach(
items: ri!testCdt,
expression:
segment: if(and(fv!item.aId=ri!tData_cdt.id ,
fv!item.tabId=ri!tData_cdt.tName,), fv!item,{})
)

 

This is returning 7 matching rows, but i want only the data of last matched row.

 

Can you you help me in that.

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Lead Developer
    in reply to PhilB
    Often it's far, far simpler with an array of data to just index it. Appian uses 1 based indexing, meaning arrays don't start at 0. This means the number of items in your list is also the index of the last one. The 20th item is at 20.

    So your two options are myCDT[length(myCDT)] or index(myCDT, length(myCDT), {}). If you expect nulls in the list, you should use the count() function instead.

    I would expect this to be much faster than any sort of looping.
Children