created web api with below code but getting below error
local!entities: a!queryEntity( entity: cons!TI_FINALEXCELTODATABASESTORE, query: a!query( pagingInfo: a!pagingInfo( startIndex: 1, batchSize: 50 ) ), fetchTotalCount: true ).data,
An error occurred while retrieving the data. Details: Unexpected error executing query (type: [TIFinalExcelToDatabaseDT7969], query: [queryentity expression], order by: [[Sort[null asc]]], filters:[null])
Discussion posts and replies are publicly visible
Looks like the problem is with the sort fields. Try to check if
You can also verify database permissions. In case if you are using alias for tables in DB, make sure verify those alias and permissions.
From the error it looks like it is expecting values for sort and filter parameters. Although the sort and filter parameter are optional in a!pagingInfo(), the a!query() should work without these parameters. Make sure the constant "cons!TI_FINALEXCELTODATABASESTORE" points to correct entity and publish the Data Store.
If you want to add record using post method in data store entity you will write code as given example below
a!localVariables( local!value: cast( 'type!{urn:com:appian:types}KBS_Categories', a!fromJson(http!request.body) ), /* API never updates existing data */ if( not( isnull(index(local!value, "catName", null)) ), a!httpResponse( statusCode: 400, headers: { a!httpHeader( name: "Content-Type", value: "application/json" ) }, body: a!toJson( { error: "The provided Category data included an id, which is not allowed. " & "You can only create new category name, not modify ones that already exist." } ) ), a!writeToDataStoreEntity( dataStoreEntity: cons!KBS_CATEGORY_API_POST, valueToStore: local!value, onSuccess: a!httpResponse( statusCode: 200, headers: { a!httpHeader( name: "Content-Type", value: "application/json" ) }, body: a!toJson(fv!storedValues) ), onError: a!httpResponse( statusCode: 500, headers: { a!httpHeader( name: "Content-Type", value: "application/json" ) }, body: a!toJson( { error: "There was an error writing to the data store" } ) ) ) ) )
I suggest to check the tomcat-stdout log file for details. I see these kind of error messages often related to timeout or memory issues.