How can I add filter conditions as OR?

Question

In statements like api.find("PGI", startRow, Filter.in("approvalState", "APPROVED", "DENIED", "AUTO_APPROVED")), the filter conditions are all cumulative and added as AND. Is there an option to add them as OR?

Answer

You can use this workaround:

Filter.or( Filter.equal("approvalState","APPROVED"), Filter.equal("approvalState","DENIED") , Filter.equal("approvalState","AUTO_APPROVED")  )

Found an issue in documentation? Write to us.