/* My intent is to run query first to capture the ids (int) from the first data entity and save those * values into local!checkIds. (In this example, I get three ids: 621, 622, 623). * Then I want to run the "queryEntity()" function on a second data entity * "cons!ABC_AMOUNT_DS" to retrieve all records (data) associated with those three ids. * If I replace local!checkIds with {621, 622, 623}, I get the results I'm looking for. * However, as it is - I'm getting an expression evaluation error (see image) */ with( local!checkIds: a!queryEntity( entity: cons!ABC_CHECK_DS, query: a!query( selection: {}, logicalExpression: a!queryLogicalExpression( operator: "OR", filters: { a!queryFilter( field: "effectiveDateTime", operator: ">=", value: todatetime("07/01/2015") ) } ), pagingInfo: a!pagingInfo( startIndex: 1, batchSize: -1, sort: a!sortInfo( field: "id", ascending: true ) ) ) ).data.id, local!entities: a!queryEntity( entity: cons!ABC_AMOUNT_DS, query: a!query( selection: {}, logicalExpression: a!queryLogicalExpression( operator: "OR", filters: { a!queryFilter( field: "checkid", operator: "in", value: local!checkIds ) } ), pagingInfo: a!pagingInfo( startIndex: 1, batchSize: -1, sort: a!sortInfo( field: "id", ascending: true ) ) ) ).data, /* * Construct an HTTP response that contains the information that we just stored * in "local!entities". */ a!httpResponse( /* * Set an HTTP header that tells the client that the body of the response * will be JSON-encoded. */ headers: { a!httpHeader(name: "content-type", value: "application/json") }, /* * JSON-encode the value of "local!entities" and place it in the response body. */ body: a!toJson(value: local!entities) ) )