"An error occurred while retrieving the data. Details: The data source [jdbc/Appian] cannot be reached or its configuration is invalid. Details: could not extract ResultSet"
I keep encountering this error while trying to add some filters to the data retrieved from a query entity. The query runs fine and retrieves all the data, however, when I go to add some dynamic filters to this data I keep encountering this error. I am reaching out to see if anyone from the community has come across the same error and what solution worked for them. Basically trying to add a few specific data filters to a search bar in the application. Any suggestions are welcome. Thank you
Discussion posts and replies are publicly visible
Guessing there's something in one of your filter definitions that doesn't work.
I created a stand-alone record type for the search bar assuming the same. This usually works for dynamic filters for multiple rows of data. But I still got the same error .
Having a hard time visualizing your problem. Code or screenshots could be helpful.
a!localVariables(
local!showSearchGrid:false(),
{
rule!ComponentDisplaySectionLink(
translations: ri!translations,
show: local!showSearchGrid,
label: ri!linkText,
icon: ri!linkIcon,
description: ri!linkDescription,
showWhen: ri!showWhen
),
a!gridField(
data: a!recordData(
recordType: 'recordType!{}process name',
filters: {
a!queryFilter(
field: 'recordType!{}process name.fields.{CreatedBy}CreatedBy',
operator: "=",
value: tostring(loggedInUser())
)
}
columns: {
a!gridColumn(
label: index(ri!translations, "global.request", null),
value: fv!row['recordType!{}process name.fields.{RequestID}RequestID']
label: index(ri!translations, "global.site", null),
value: fv!row['recordType!{}process name.fields.{SiteEn}SiteEn']
label: index(ri!translations,"global.tradeName",null),
value: fv!row['recordType!{}process name.fields.{ProductNameEn}ProductNameEn']
label: index(ri!translations,"global.manufacturer",null),
value: fv!row['recordType!{}process name.fields.{ManufacturerNameEn}ManufacturerNameEn']
label: index(ri!translations,"global.patientInitials", null),
value: fv!row['recordType!{}process name.fields.{PatientInitials}PatientInitials']
label: index(ri!translations, "global.created", null),
value: fv!row['recordType!{}process name.fields.{Created}Created']
},
showWhen: local!showSearchGrid
This is a Record Type query. The error is likely not here as you said you were trying to add some user filters.
So you think the issue is the data store itself?
I have no idea. You said there was an issue with queryEntity but you posted a Record Type query.
Since the query entity was returning this error I created a record type entity as a work around. But the same error is occurring in this case as well. I can share the query entity code as well
load(
local!gridSelection: a!gridSelection(
pagingInfo: a!pagingInfo(
startIndex: 1,
batchSize: cons!process name ,
sort: a!sortInfo(field: ri!sortAttribute)
selected: index(
ri!selectedObjects,
ri!recordIDAttribute,
null
local!showSearchGrid: false(),
local!searchValue,
with(
local!enableSearch: not(rule!GLB_isEmpty(ri!searchAttributes)),
local!datasubset: if(
rule!GLB_valueOrDefault(local!showSearchGrid, false()),
a!queryEntity_22r2(
entity: ri!entity,
fetchTotalCount: true(),
query: a!query(
pagingInfo: if(
isnull(ri!gridSelection),
local!gridSelection.pagingInfo,
ri!gridSelection.pagingInfo
logicalExpression: a!queryLogicalExpression(
operator: "AND",
filters: if(
rule!GLB_isEmpty(ri!additionalQueryFilters),
{},
ri!additionalQueryFilters
logicalExpressions: if(
and(
local!enableSearch,
rule!GLB_hasValue(local!searchValue)
a!queryLogicalExpression(
if(
rule!GLB_isEmpty(ri!searchAttributes),
a!forEach(
items: ri!searchAttributes,
expression: a!queryFilter(
field: index(fv!item, "Name", null),
operator: choose(
wherecontains(
tostring(index(fv!item, "Type", null)),
touniformstring({ "INTEGER", "TEXT" })
"=",
"includes"
value:choose(
isnull(tointeger(local!searchValue)),
1,
tointeger(local!searchValue)
tostring(local!searchValue)
applyWhen: not(rule!GLB_isBlank(local!searchValue))
/*new code*/
ri!entity = cons!process name,
field: "IsArchived",
value: false()
{}
ignoreFiltersWithEmptyValues: true()
todatasubset({})
local!moreThanMaxselections: and(
not(rule!GLB_isBlank(ri!maxSelections)),
rule!GLB_length(
local!gridSelection.selected,
ri!gridSelection.selected
) > ri!maxSelections
rule!process name(
a!columnsLayout(
showWhen: and(
local!showSearchGrid,
local!enableSearch
a!columnLayout(
contents: {
a!textField(
label: "Search",
value: local!searchValue,
saveInto: {
a!save(
local!gridSelection.pagingInfo.StartIndex,
ri!gridSelection.pagingInfo.StartIndex
1
a!columnLayout(contents: {}),
a!columnLayout(contents: {})
a!gridField_19r1(
showWhen: local!showSearchGrid,
identifiers: index(
local!datasubset.data,
selection: true(),
selectionStyle: "ROW_HIGHLIGHT",
totalCount: index(local!datasubset, "totalCount", 0),
value: if(
local!gridSelection,
ri!gridSelection
saveInto: if(
columns: a!forEach(
items: ri!columnAttributes,
expression: with(
local!columnList: index(
stripwith(fv!item, " "),
a!gridTextColumn(
label: if(
rule!GLB_isEmpty(ri!columnLabels),
fv!item,
index(ri!columnLabels, fv!index, null)
field: stripwith(fv!item, " "),
data: if(
contains({ "Created", "Updated" }, fv!item),
apply(
rule!GLB_displayDate(date: _),
local!columnList
contains({ "Province" }, fv!item),
rule!process name(key: _, translations: ri!translations),
links: if(
contains({ "Record ID", "Request ID" }, fv!item),
a!recordLink(
recordType: con! Process name,
identifier: _
validations: {
local!moreThanMaxselections,
index(
ri!translations,
"sectionSearchableSelectionList.warning1part1",
) & " " & ri!maxSelections & " " & index(
"sectionSearchableSelectionList.warning1part2",
a!buttonArrayLayout(
align: "END",
buttons: {
a!buttonWidget(
label: index(ri!translations, "global.clear", {}),
confirmMessage: index(
"sectionSearchObjects.clearConfirm",
disabled: rule!GLB_isEmpty(
a!save(ri!selectedObjects, null),
a!save(local!gridSelection.selected, null),
a!save(ri!gridSelection.selected, null)
a!save(local!showSearchGrid, false()),
ri!additionalClears
label: ri!buttonText,
style: "PRIMARY",
disabled: or(
rule!GLB_isEmpty(
local!moreThanMaxselections
cast(
ri!objectType,
rule! Name queryEntity(
recordIDList: index(
"selected",
attribute: ri!recordIDAttribute
"data",
ri!additionalSaves
FWIW, this latest comment is essntially unreadable, and makes the therad pretty much unreadable as well. Please edit your comment and re-paste the code using a Code Box (make sure you re-copy from the source so it retains indentation).
done