Is there a way by which we can sort integer number array. I can't find any f

Is there a way by which we can sort integer number array. I can't find any functions that could do it easily. Tried doing an union of empty set with the array but didn't work. Any ideas would be deeply appreciated.

thanks,...

OriginalPostID-133670

OriginalPostID-133670

  Discussion posts and replies are publicly visible

Parents
  • I know this is an old question but for anyone searching now or in the future it is possible to do this without using a plugin

    This is what I've done

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

    First it casts an array of integers into an array of dictionaries and then it uses Appians sort functions to apply a sort. Finally it extracts the values into a new array.

    The dictionary cast is necessary in order for the sort to understand what it is meant to order it by.

Reply
  • I know this is an old question but for anyone searching now or in the future it is possible to do this without using a plugin

    This is what I've done

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

    First it casts an array of integers into an array of dictionaries and then it uses Appians sort functions to apply a sort. Finally it extracts the values into a new array.

    The dictionary cast is necessary in order for the sort to understand what it is meant to order it by.

Children