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
  • 0
    Certified Senior Developer
    Hi Saurav ,

    Try like below will give you last match

    load(
    local!data: {
    "a",
    "b",
    "d",
    "e"
    },
    local!data1: {
    "a",
    "d",
    "f"
    },
    a!forEach(
    items:intersection(local!data,local!data1),
    expression:
    if(
    fv!isLast,
    fv!item,
    {}
    )

    )

    )

    Thanks
  • I tried this also but getting below error.

    local!lastRowDetails: a!forEach(
    items: ri!tCdt,
    expression:if(
    and(
    fv!item.A = ri!test_cdt.A,
    fv!item.B = ri!test_cdt.B,
    fv!item.C= ri!test_cdt.C
    ), if(
    fv!isLast,
    fv!item,
    {}
    ),
    {}
    ))

    a!textField( local!lastRowDetails.id),

    Could not display interface. Please check definition and inputs.
    Interface Definition: Expression evaluation error at function a!textField [line 390]: Invalid index: Cannot index property 'id' of type Text into type List of Variant
Reply
  • I tried this also but getting below error.

    local!lastRowDetails: a!forEach(
    items: ri!tCdt,
    expression:if(
    and(
    fv!item.A = ri!test_cdt.A,
    fv!item.B = ri!test_cdt.B,
    fv!item.C= ri!test_cdt.C
    ), if(
    fv!isLast,
    fv!item,
    {}
    ),
    {}
    ))

    a!textField( local!lastRowDetails.id),

    Could not display interface. Please check definition and inputs.
    Interface Definition: Expression evaluation error at function a!textField [line 390]: Invalid index: Cannot index property 'id' of type Text into type List of Variant
Children
No Data