Using a queryEntity expression, would it be possible to set a queryFilter that c

Using a queryEntity expression, would it be possible to set a queryFilter that compares two entity fields for a condition? For example, if I want to query set of tasks from tasks table that are overdue, can I specify queryFilter in such a way that checks if 'taskCompletionTime' > 'taskDeadLineTime' and these are fields in my cdt/entity. This type of filtering is possible in SQL and I think it’s a nice one to have in Appian too that saves us from creating a database view for such simple usecases. Did anyone encounter similar ideas and/or what are the best possible ways to do it besides creating a view?

OriginalPostID-223882

OriginalPostID-223882

  Discussion posts and replies are publicly visible

Parents
  • The a!queryFilter allows only one field to be specified. So, you cannot filter by comparing two fields.
    Since you are looking for a solution which does not use a DB View, I suggest the following:
    When using the a!queryEntity function, do not try to filter based on 'taskCompletionTime' > 'taskDeadLineTime' . Instead get all the data(you can ofcourse use the other queryFilters if you are applying them) .
    Then, create another rule which takes only one CDT object. Check for the condition in it 'taskCompletionTime' > 'taskDeadLineTime' . You can say: myCDT.taskCompletionTime > myCDT.taskDeadlineTime. Then. you can use the filter() function to filter out the CDTs which satisfy the rule we just created.

    That way you will be able to filter out the necessary items.
    This is a little cumbersome - but it is fine if you want to avoid creating a DB view - however, it will cause slight overhead on Appian UI.
Reply
  • The a!queryFilter allows only one field to be specified. So, you cannot filter by comparing two fields.
    Since you are looking for a solution which does not use a DB View, I suggest the following:
    When using the a!queryEntity function, do not try to filter based on 'taskCompletionTime' > 'taskDeadLineTime' . Instead get all the data(you can ofcourse use the other queryFilters if you are applying them) .
    Then, create another rule which takes only one CDT object. Check for the condition in it 'taskCompletionTime' > 'taskDeadLineTime' . You can say: myCDT.taskCompletionTime > myCDT.taskDeadlineTime. Then. you can use the filter() function to filter out the CDTs which satisfy the rule we just created.

    That way you will be able to filter out the necessary items.
    This is a little cumbersome - but it is fine if you want to avoid creating a DB view - however, it will cause slight overhead on Appian UI.
Children
No Data