Skip to main content
Best answer by stewart.burchell

An intermittent issue might be data related because it might depend on the context in which an individual data retrieval takes place. If you have no filters, that might result in fetching a large amount of data which may cause the issue. Or using certain filter values might retrieve a row from the database that has a bad data value. You should be able to find more details about the error in the logs.

5 replies

saahilm0002
November 22, 2021

if(rule!APN_isBlank(ri!studyId),{},a!queryEntity(
entity: cons!SSU_DSE_VW_STUDY_QUESTION_READ_ONLY,
query: a!query(
selection: if(rule!APN_isBlank(ri!selection),{},
a!querySelection(
columns: a!forEach(
items: ri!selection,
expression:
a!queryColumn(
field: fv!item
)
)

)),
logicalExpression:
a!queryLogicalExpression(
operator: "AND",
filters: {
a!queryFilter(
field: "studyId_Pk",
operator: "=",
value: ri!studyId
),
a!queryFilter(
field: "answerId_Pk",
operator: "in",
value: ri!answerId
),
a!queryFilter(
field: "questionId_Pk",
operator: "in",
value: ri!questionIds
),
a!queryFilter(
field: "keyCoreProcess",
operator: "in",
value: ri!keyCoreProcess
),
a!queryFilter(
field: "keyCoreProcessName",
operator: "in",
value: ri!keyCoreProcessName
),
a!queryFilter(
field: "answeredBy",
operator: "in",
value: ri!answeredBy
),
a!queryFilter(
field: "studyQuestionStatus",
operator: "in",
value: ri!studyQuestionStatus
),
a!queryFilter(
field: "questionlabel",
operator: "includes",
value: ri!questionLabel
),
a!queryFilter(
field: "status",
operator: "in",
value: ri!adminStatus
),
a!queryFilter(
field: "ansProviderRole",
operator: "in",
value:ri!ansProviderRole
),
if(ri!needAttention=0,
a!queryFilter(
field: "needAttention",
operator: "is null",
),
a!queryFilter(
field: "needAttention",
operator: "=",
value: ri!needAttention,
)
),
a!queryFilter(
field: "isApplicable",
operator: "=",
value: 1,
applyWhen: or(ri!studyQuestionStatus="Need Attention",ri!needAttention=1)
),
a!queryFilter(
field: "isActive",
operator: "=",
value: 1,
applyWhen: or(ri!studyQuestionStatus="Need Attention",ri!needAttention=1)
),
a!queryFilter(
field: "questionIdentifier",
operator:"in",
value: ri!questionIdentifier
),
a!queryFilter(
field: "isApplicable",
operator: "=",
value: tointeger(ri!isApplicable)
)

},
ignoreFiltersWithEmptyValues: true()
) ,
pagingInfo:
if(rule!APN_isBlank(ri!pagingInfo),
a!pagingInfo(
startIndex: 1,
batchSize: -1,
sort: a!sortInfo(
field: "keyCoreProcessName",
ascending: true()
)
),ri!pagingInfo
)
),
fetchTotalCount: ri!fetchTotalCount
))

This is the expression, and ri!selection is not being passed.

stewart.burchell
November 22, 2021

1. For future reference please use the "Insert Code" option as it make sit easier to read the code and for folk to copy/paste it to their own Appian instance when trying to resolve the issues:

2. if the issue is intermittent then the problem is probably with thee data and not the code. The message "An error occurred while retrieving the data" can be too much data (there is a limit on the amount of data that can be retrieved in one call) or bad data (e.g. a datetime field that contains an invalid datetime value such as '0000-00-00 00:00:00')

saahilm0002
November 22, 2021

stewart.burchell: Thanks for the suggestion on "insert code" that really helped.

As you said, lets assume if the issue is because of bad data. Then will this cause the issue to be intermittent?