Skip to main content
sivakrishnam0002
Known Participant
Jun 30, 2023 9:04 AM UTC
Question

Filtering by multiple conditions

ID

refId

Title

Status

1

10

Test1

Approved

2

10

Test2

In-Review

3

10

Test3

Approved

4

10

Test4

Approved

How to write query filter to fetch refId=10 when status all rows should be Approved

    7 replies

    sanchitg0002
    Inspiring
    Jun 30, 2023 9:10 AM UTC

    I don't think this is a challenge for a Certified Associate Dev. Just write two query filters with "AND" operator in queryLogicalExpression(). One for refId=10 and other for Status="Approved".

    sivakrishnam0002
    Known Participant
    Jun 30, 2023 9:15 AM UTC

    is it possible to write single filter without using refId=10

    sanchitg0002
    Inspiring
    Jun 30, 2023 9:18 AM UTC

    What? No. Can you please explain the requirements more clearly?

    mathieud0001
    Genius
    Jun 30, 2023 11:33 AM UTC

    Personally, the easiest way to do this if you are using Records would be to do a aggregate related record (custom record field) on the parent record where you count all the records <> approved. You then make a query that filters on the ref ids that have 0 "unapproved" records.