Hi,
Is there any way I can get the size (number of rows) of a view by running a code in Expression Rule?
In addition,
Is there any way I can write SQL queries directly in Expression Rule?
Thanks in advance
Discussion posts and replies are publicly visible
https://docs.appian.com/suite/help/22.4/fnc_system_a_queryentity.html#using-the-fetchtotalcount-parameter
We cannot write SQL code in an expression rule. What is your use case? Maybe there are alternative ways.
Thank you very much.
I would like to "run" the following query:
SELECT COUNT(*) FROM <table_name>WHERE <table_name>.<column_name> >= CAST(CURRENT_TIMESTAMP() AS DATE) - INTERVAL 1 DAY
According to your suggestion, I use a!queryEntity() to count the number of rows.
However, how can I add the condition (where)?
barm said:However, how can I add the condition (where)?
Of course. a!queryEntity() accepts a broad variety of filtering parameters, via a!queryFilter() and a!queryLogicalExpression. You'd just add an a!queryFilter like, a!queryFilter(field: "myTimestampField", operator: ">=", value: today() - 1), or similar.