I have an odd problem. I have a read only grid what shows a value one way on the interface, but differently in the excel download.
Here is what you see in the interface vs the excel spreadsheet.
Here is the offending code in the Grid.
a!gridColumn( label: "Residential Status", value: rule!CMS_GetCurrentResidentialStatusId(fv!row['recordType!CMS Clergy Member Status Report.fields.clergyId']) ),
Here is the expression rule.
a!localVariables( /* * Get list of current resendential type addresses for clergy member * ordered by start date */ local!residentialAddressData: a!queryEntity( entity: cons!CMS_ADDRESS_CLERGY_ASSIGNED_ADDRESS, query: a!query( selection: a!querySelection( columns: { a!queryColumn( field: "clergyAddress.residentialStatus.status" ) } ), logicalExpression: a!queryLogicalExpression( operator: "AND", logicalExpressions: { a!queryLogicalExpression( operator: "AND", filters: { a!queryFilter( field: "clergyId", operator: "=", value: ri!clergyMemberId ), a!queryFilter( field: "clergyAddress.addressType.addressType", operator: "in", value: { "Home", "Rectory" } ), a!queryFilter( field: "clergyAddressStart", operator: "<=", value: todate(now()) ) } ), a!queryLogicalExpression( operator: "OR", filters: { a!queryFilter( field: "clergyAddressEnd", operator: "is null" ), a!queryFilter( field: "clergyAddressEnd", operator: ">", value: todate(now()) ) } ) } ), pagingInfo: a!pagingInfo( startIndex: 1, batchSize: - 1, sort: a!sortInfo( field: "clergyAddressStart", ascending: false ) ) ) ).data, if( count(local!residentialAddressData) > 0, local!residentialAddressData[1].clergyAddress.residentialStatus.status, null ) )
Here is what the expression rule returns.
Discussion posts and replies are publicly visible
I detected an antipattern: Querying in a Loop
Antipatterns: Solution Design Mistakes to Avoid in Appian
Did you consider a custom record field to directly hold that value?
Is there a way to do that when the value is held in a CDT-based table? After playing with it for a few minutes it seems like the answer is still "no".
Stefan Helzle said:a custom record field
Correct. But it still is a problematic design decision worth pointing out.
Chris.Gillespie , did you try to add a tostring() to line 67 in your expression? It seems like it returns a text wrapped into an any type. That Excel export might not like that.
That did it!!!! Thank you to both of you!!!!!
Cool! Keep in mind that querying in a loop is a performance risk.