Skip to main content
Inspiring
January 18, 2024
Question

Function

  • January 18, 2024
  • 9 replies
  • 0 views

Did Appian remove sortintegerarray() ,sortdecimealarry() ,sorttextarray().       function 

    9 replies

    harshitb6843
    January 18, 2024

    These functions existed? Never heard of them.

    harshitb6843
    January 18, 2024

    You can use this code instead. 

    a!localVariables(
      local!data: a!forEach(
        items: ri!array,
        expression: { value: fv!item }
      ),
      todatasubset(
        local!data,
        a!pagingInfo(
          startIndex: 1,
          batchSize: - 1,
          sort: a!sortInfo(field: "value", ascending: or(ri!ascending))
        )
      ).data.value
    )

    Isolate this in an expression rule and use it anywhere in your app. 

    mikes0011
    Brainy
    January 19, 2024

    I think you have a misprint in here. You have a rule input for "ascending" as i'd expect, but instead of using that you have "or(ri!array)".

    I would expect perhaps that part to say "ascending: a!defaultValue(ri!ascending, true())" - and just note that the default behavior of the expression rule will be to sort in an ascending manner unless specified otherwise.

    mathieud0001
    January 19, 2024

    I think a plugin is overkill for this kind of functionality. Probably best to use the method suggested by Harshit.