a!queryEntity: An error occurred while retrieving the data

Hi All,

 

I am trying to retrieve data from DB by using query entity. I am able to fetch 10,000 records beyond that I am getting "a!queryEntity: An error occurred while retrieving the data".

 

I have more than 18000 records in my table which I need to display in a paging grid with filter options. I have check the performance of my view at DB end. It is not even taking 1 second to execute that view not sure why with query entity is not able to fetch all records. When in my paging info I am giving batchsize more that 10000 or -1, it gives me the error below this, it is working fine. Not sure if query Entity has limitation in fetching number of rows.

 

Please share, if I can use some other way to fetch all the records from DB and use in my interface.

 

Thanks in advance !!

 

Regards

Anusha  

  Discussion posts and replies are publicly visible

Parents
  • Hi Anusha,

    Try below code and replace the query entity with your query entity and pass the paging info with batch size as your requirement(It will fetch the batch Size records only each time and it will be speed and won't give you error.)

    load
    ( /* Set the default paging and sorting config */ local!gridSelection: a!gridSelection( selected: {}, pagingInfo: a!pagingInfo( startIndex: 1, batchSize: 50, sort: a!sortInfo( field: "lastName", ascending: true ) ) ), with( local!datasubset: a!queryEntity( entity: cons!EMPLOYEE_ENTITY, query: a!query( selection: a!querySelection( columns: { a!queryColumn( field: "firstName" ), a!queryColumn( field: "lastName" ), a!queryColumn( field: "title" ) } ), pagingInfo: local!gridSelection.pagingInfo ) ), a!sectionLayout( contents: { a!gridField( label: "SAIL Example: Employee Grid Selection", totalCount: local!datasubset.totalCount, columns: { a!gridTextColumn( label: "First", field: "firstName", data: index( local!datasubset.data, "firstName", {} ) ), a!gridTextColumn( label: "Last", field: "lastName", data: index( local!datasubset.data, "lastName", {} ) ), a!gridTextColumn( label: "Title", field: "title", data: index( local!datasubset.data, "title", {} ) ) }, identifiers: local!datasubset.identifiers, value: local!gridSelection, saveInto: { local!gridSelection }, selection: true, shadeAlternateRows: false, selectionStyle: "ROW_HIGHLIGHT" ), a!textField( label: "Selected Employee IDs", readOnly: true, value: if( length( local!gridSelection.selected ) = 0, "No employees selected", joinarray( local!gridSelection.selected, ", " ) ) ) } ) ) )


    Thanks
    Siva Chimata
  • Hi , thanks it sounds it can work, but identifiers are not working for latest Appian version, could you update your recommendation? thanks

  • I'd suggest creating a new post with the issue you're having and provide some more context. This error "An error occurred while retrieving the data" is pretty generic so your use case may have an entirely different cause.

Reply Children
No Data