Skip to main content
Inspiring
Jan 18, 2024 5:53 AM UTC
Question

Function

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

    9 replies

    harshitb6843
    Brainy
    Jan 18, 2024 6:19 AM UTC

    These functions existed? Never heard of them.

    harshitb6843
    Brainy
    Jan 18, 2024 6:22 AM UTC

    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
    Jan 19, 2024 8:24 PM UTC

    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.

    The Expression Guru
    mathieud0001
    Genius
    Jan 19, 2024 11:52 PM UTC

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