Hi All,
I am running below query to get the data from a table which has 1000+ rows . But it gives me error "Expression evaluation error at function a!queryEntity: An error occurred while retrieving the data." .
When i query DB it doesn't take more than 20 ms . Any help on what can be done?
a!queryEntity( entity: cons!XYZ, query: a!query( logicalExpression: a!queryLogicalExpression( operator: "AND", filters: { a!queryFilter( field: "helpId", operator: "=", value: 2 ) }, ignoreFiltersWithEmptyValues: true ), pagingInfo: a!pagingInfo( startIndex: 1, batchSize: -1 ) ), fetchTotalCount: true).data
Thanks in advance
Discussion posts and replies are publicly visible
Hi Anu,
Can you please try to to minimize the data that you are retriving by configuring the paginginfo as, (1,200) or something instaed of trying to fetch the entire set of records. If your idea is to display these data in a grid, then minimizing the data retrival through pagingInfo would definitely work.
Application-server log will have an error with a stack trace with more details on why exactly this failed. Can you share the error with us?
If this kind of issues occur there might be 2 reasons for this
1. If there is any date time fields in ur query and if any of the row has the value as 0000-00-00 it will throw an error
2. If there is a huge data which is taking the query to execute more than 10 seconds it will throw an error,
To see this error pls check in the perflogs/rdbms logs where it will tell whether it is taking 10 seconds in execution time .
I'd also suggest trying to narrow down the set of fields you are trying to return. For instance, use a query selection to only return certain columns. Then, you can find out if one of the columns cannot be queried and you can investigate that column further.
I'd also suggest checking your data store. In the data store, try to validate and see if there are any errors when validating your CDTs against the current database structure.
Also to note there is a size limitation on the data, I believe defaulted to around 1 MB of data can be returned. I would also suggest testing by simply changing the batchSize to 10 and see if the issue is still present.
Check if you have datefield in the database table that has "00:00:00 000" value , sometimes it cause the retrieving data from Appian fail
There could be various reasons for this. So you have to narrow down the possiblities.
1. Datastore is verified for the entity. As it might be possible something changed in the view or table which is causing the connection between the datastore and the DB.
2. Since you are querying all the data, there can be the possibility that the server limit of QE is reached and thus giving you the error. So try to reduce the batch size.
3. Try to reduce the number of columns in the QE, As I see you are fetching all the columns.
4. Database connection issue.
Let me know if it helps
Batch size in appian helps in retrieving the large data sets in an efficient way whilst showing the count of whole data set.
Example: When batch size is set to -1, the effective batch size is unlimited. There is no preliminary count query when batch size is unlimited, (and hence the reduced latency, i.e. it's faster).
Thanks,
ravalik