How to query Record Type by Comparing Record Type field and Relationship field?

Certified Lead Developer

Hi,

Could you please help me with the below requirement

Sample Table and Data

RequestTable

id name       email                 createdOn            createdBy
1    N1   n1@mail.com 2020-07-27 13:15:30 n1@mail.com
2    N2   n2@mail.com 2020-07-27 13:15:30 n2@mail.com
3    N3   n3@mail.com 2020-07-27 13:15:30 n3@mail.com
4    N4   n4@mail.com 2020-07-27 13:15:30 n4@mail.com
2    N5   n5@mail.com 2020-07-27 13:15:30 n5@mail.com

Conversation:

id  reqId    message       sentBy
1    1            Xyz         n1@mail.com
2    1            abc         reviewer1@mail.com
3    1            pqr          admin@mail.com
4    2            xxx          reviewer2@mail.com
5    2            yyy          n2@mail.com
6    2            zzz          n2@mail.com

I want to get the Conversations which are not sentBy the same user of that particular request

Below is the SQL query:

SELECT b.* FROM RequestTable a join  Conversation  b on(a.id=b.reqId) where a.createdBy<>b.sentBy and a.id=1;

Output:

id  reqId    message       sentBy
2    1            abc         reviewer1@mail.com
3    1            pqr          admin@mail.com

I wanted to know how to achieve it in Appian using Record Types

Thanks

  Discussion posts and replies are publicly visible

Parents Reply Children
  • 0
    Certified Lead Developer
    in reply to Sri Ram Kaja

    Hi  ,

    Thanks for Reply.

    I know we can use related record fields for filtering.

    But the problem here is

    we have to use value as Record field.

    SELECT b.* FROM RequestTable a join  Conversation  b on(a.id=b.reqId) where a.createdBy<>b.sentBy and a.id=1;

    In the above query we have to use record fields both sides (  a.createdBy<>b.sentBy ).

    As I tried there is option to provide record field as value in filter