Checking if all documents in a list have the same extension without using forEach()

Certified Senior Developer

Hi,

Currently have a rule containing the following where the rule input is a list of documents and constant has text "DOCX"

return true if all document extensions in a list have the extension "DOCX" otherwise return false.

and(
a!forEach(
items: ri!receivedDocumentsList,
expression: document(
fv!item,
"extension"
) = cons!DOCUMENT_EXTENSION_DOCX
)
)

Which works fine but is there a more elegant way to do this?

Regards

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Senior Developer
    in reply to Konduru Chaitanya

    Hi,

    The rule is to be called from a process model in an xor node. Depending on the boolean value returned to the process model different processing then takes place.

    In this first iteration of the rule development a constant is being used but this would be replaced in time by another rule input to allow any extension to be checked.

    I had thought of apply() but saw this....

    Regards

Children