Skip to main content
September 20, 2023
Question

how to short record field with integer value

  • September 20, 2023
  • 12 replies
  • 0 views

Hi,

have a requirement to short a record field which have integer value

how can i do that ?

    12 replies

    mathieud0001
    Brainy
    September 20, 2023

    What do you mean by "short"?

    September 21, 2023

    means vallue should come in ascending  order

    like {2,5,1,9,7}=={1,2,5,7,9}

    rishikeshr4182
    September 21, 2023

    If you have a use case to sort random integer value. You can wrap the value in a map and then apply todatasubset, where you will get sorting function for your desire output.

    a!localVariables(
    local!data: { 2, 5, 1, 9, 7 },
    tointeger(
    todatasubset(
    a!forEach(
    items: local!data,
    expression: { value: fv!item }
    ),
    a!pagingInfo(
    startIndex: 1,
    batchSize: - 1,
    sort: a!sortInfo(field: "value", ascending: true)
    )
    ).data.value
    )
    )