Hello Community,
Trying to sort a query field that is currently text but hold dates. Was wondering if in the query it might be possible to cast as type date.
Currently attempting to sort the C2 column, however due to it being text it's not correct.
query: a!query( pagingInfo: a!pagingInfo( startIndex: 1, batchSize: 1000, sort: a!sortInfo(field: "c2", ascending: true) ), logicalExpression: a!queryLogicalExpression( operator: "AND", filters: { a!queryFilter( field: "c4", operator: "includes", value: local!activityFilter, applyWhen: not(isnull(local!activityFilter)) ), a!queryFilter( field: "c1", operator: "in", value: local!statusFilter, applyWhen: a!isNotNullOrEmpty(local!statusFilter) ), }, logicalExpressions: a!queryLogicalExpression( operator: "OR", filters: { a!queryFilter( field: "c2", operator: "starts with", value: "Enrollment" ), a!queryFilter( field: "c2", operator: "starts with", value: "Screening" ) } ) )
Discussion posts and replies are publicly visible
I can't figure out what you mean by "is currently text but hold dates". Is it text, or is it a date? Your queryFilters seem to believe it will be text holding something other than "dates", since it's trying to find only entries starting with "Enrollment" or "Screening". If the field is text, it should sort as normal by lexical order. I'm not sure what you're hoping to "cast as type date" in this.
It looks like the task list was build from an example in an Appian post: https://docs.appian.com/suite/help/22.3/fnc_system_a_queryprocessanalytics.html
Fields look the same.
I'm familiar with that function. I'm not sure what information this is supposed to be giving me about your column C2, though, and what data / type of data it's returning/expected to return.