Does Appian has any default function to get the Max/ latest date?

Hi,

Does Appian have any defualt  function to get the Max/ latest date from a date array if the data is like below?

2018-10-26T20:41:55

2017-02-26T18:21:39

2019-07-26T10:01:21 

Thanks in Advance

  Discussion posts and replies are publicly visible

Parents Reply
  • +1
    Certified Lead Developer
    in reply to adithyay

    The attached alternative code sample (which i've actually tested this time) will demonstrate how you can manually sort your text array (using officially supported functionality), and using a the specified pagingInfo value, select just the first result automatically (which should be the highest).  Let me know if you have any questions.

    with(
      local!array: {
        "2018-12-04T19:24:44",
        "2017-09-26T20:41:35"
      },
      
      todatasubset(
        a!forEach(
          local!array,
          {
            text: fv!item
          }
        ),
        a!pagingInfo(
          startIndex: 1,
          batchSize: 1,
          sort: a!sortInfo(
            field: "text",
            ascending: false()
          )
        )
      ).data.text
    )

Children