Hi Everyone,
I am querying the db table through query record type. This query gives the list of db records. When I am using this in interface and using index to get the particular field, it gives this list of particular field. In case of null or single it also gives list. Can anyone please help me when it is null or single value should not give list.
Discussion posts and replies are publicly visible
Please share the code snippet of both your query rule and the interface.
Below query I am using for diffrent record types
a!localVariables( local!data: a!queryRecordType( recordType: "recordType!HM Patient", fields: ri!selectionField, filters: a!queryLogicalExpression( logicalExpressions: ri!logicalExpression, operator: "AND", filters: { a!queryFilter( field: "recordType!HM Patient.fields.patientIdPk_int", operator: "=", value: ri!patientIdPk_int ), a!queryFilter( field: "recordType!HM Patient.fields.genderId_int", operator: "=", value: ri!genderId_int ), ri!filters }, ignoreFiltersWithEmptyValues: true ), pagingInfo: a!defaultValue( value: ri!pagingInfo, default: a!pagingInfo( startIndex: 1, batchSize: 50, sort: { a!sortInfo( field: "recordType!HM Patient.fields.patientIdPk_int", ascending: false() ) } ) ), fetchTotalCount: or(ri!fetchTotalCount_bool) ), if( or(ri!returnDataSubset_bool), local!data, index(local!data, "data", {}) ) )
let me know if my earlier reply (below) makes any sense. it looks like this is a standard use case, though it'll depend on exactly what the context is in which you want to force the returned value to not snow up as a list.