As you know Query Rule has been deprecated in newer versions of Appian. I need a function that will mimic the exact behaviour of Query rule including the return type.
I have tried using queryEntity() but the return type is not the same as query rule so i am facing a lot of issues.
Keep in mind also that traditional query rules will pass back a "dataSubset" type whenever pagingInfo is passed in.
Given this, I've previously set up a standard QE recipe which I usually make a new version of for each CDT i might be querying. In that QE expression rule, I run the query entity as normal (using the passed-in pagingInfo if it was given, and a generic set otherwise); then I return the whole dataSubset if the pagingInfo was provided, and return just the ".data" result from the query entity otherwise.
Note that this does return basically an "any type" dictionary instead of a type-cast CDT. I've almost never had an issue with this - it does mean that a very few things need to be manually typecast when these are used. You could take the subsequent step of typecasting your ".data" output as the CDT type, but this creates its own issues (such as, if the QE returns a selected set of columns instead of all columns).
What exactly is your use case for needing the exact return type? What issues is this causing?
Discussion posts and replies are publicly visible
© 2020 Appian. All rights reserved.