How to get the No. of documents created last day

Certified Associate Developer

I have requirement to get the no of documents created last day/yesterday in KC.

We have a function to get the number of documents present in KC :  knowledgecenter(ri!folderId,"numberOfDocuments")

Can anyone please how to approach. Thanks in advance

  Discussion posts and replies are publicly visible

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

    An alternative approach

    a!localVariables(
      local!document: folder(
        cons!LSME_DOCUMENT_FOLDER,
        "documentChildren"
      ),
      sum(
        a!forEach(
          items: local!document,
          expression: todate(document(fv!item, "dateCreated")) > today()-1,
        )
      )
    )

    When converting a boolean value into an integer, it becomes 0 for false and 1 for true. We can use that to calculate the sum of true values in a boolean list.

    BTW, a comparison always evaluates to a boolean. Putting it into an if() will not make this a more elegant implementation.

Children
No Data