Query rule substitute

Hi, 

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. 

Please help! 

TIA 

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    It sounds like you're saving your query result into a local variable.  Local variables take on the datatype of whatever they contain.  So I think typeof() of your local variable would return "Dictionary".  In that case, I wouldn't try wrapping the query entity expression rule in a cast() function, but I would try wrapping the call to that query entity rule in a cast() right there in your local! definition.  typeof() might be a good test to run first to make sure that part is working.

    What's possibly occurring is you sometimes return a null for a particular column, and so when Appian is building a Dictionary in particular, it saves space by not saving the null.  Either that or it's the fact that for Dictionary to work it requires both key AND value.  None of the Dictionaries in your list of them need to have identical sets of keys.  But if you cast it as a list of CDT, they all DO have to have the same keys.

Reply
  • 0
    Certified Lead Developer

    It sounds like you're saving your query result into a local variable.  Local variables take on the datatype of whatever they contain.  So I think typeof() of your local variable would return "Dictionary".  In that case, I wouldn't try wrapping the query entity expression rule in a cast() function, but I would try wrapping the call to that query entity rule in a cast() right there in your local! definition.  typeof() might be a good test to run first to make sure that part is working.

    What's possibly occurring is you sometimes return a null for a particular column, and so when Appian is building a Dictionary in particular, it saves space by not saving the null.  Either that or it's the fact that for Dictionary to work it requires both key AND value.  None of the Dictionaries in your list of them need to have identical sets of keys.  But if you cast it as a list of CDT, they all DO have to have the same keys.

Children
No Data