Skip to main content
June 13, 2023
Question

Printing duration in appian

  • June 13, 2023
  • 1 reply
  • 0 views

Hi, how can I print duration in Appian? Is there any function?

    1 reply

    stefanhelzle0001
    Brainy
    June 13, 2023

    There is no ready made function. In my toolbox there is an expression which splits the string generated from the duration and displays is as required.

    Depending on your use case, this pattern might fit:

    https://docs.appian.com/suite/help/23.2/duration-display-pattern.html

    a!localVariables(
        local!parts: split(ri!value, ":"),
        local!days: tointeger(index(local!parts, 1, 0)),
        local!hours: local!days * 24 + tointeger(index(local!parts, 3, 0)),
        local!minutes: tointeger(index(local!parts, 4, 0)),
        substitute(
          trim(
            text(
              local!hours*100+local!minutes,
              "## 00"
            )
          ),
          " ",
          ":"
        ),
      )