Unable to fetch data using query entity

I am trying to fetch the data using intital values from the search 

Ex. If Package ID is 10825 then I can type 10 or 25 etc. and should get complete list of package id containing those numbers displayed in search result

i tried using IN and INCLUDES but getting error and it is a wired thing can someone help i am using appian 17.4 

a!queryEntity(
entity: cons!TMOS_ETY_WF_EXEC_AUDIT,
query: a!query(
filter: a!queryFilter(
field: "packageID",
operator: "INCLUDES",
value: ri!packageID
),
pagingInfo: a!pagingInfo(
startIndex: 1,
batchSize: - 1
)
)
)

error:-

Expression evaluation error at function a!queryEntity: Cannot apply operator [INCLUDES] to field [packageID] when comparing to value [TypedValue[it=101,v={4}]].

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    The "INCLUDES" operator is intended for comparing text, so it wouldn't be expected to work on integer data (which I assume your "packageID" is).  "IN" should work, but is used for exact matches against an array, i.e. you'd query "IN" and pass in an array i.e. {11, 22, 33}, and any packages with an ID of 11, 22, or 33 (but not "7225") would be returned.

    Assuming I'm correct about packageID's type, and if you really need to do an "INCLUDES" search against it from an interface, for example, then you should be able to create a View that is basically a recreation of that table but with the addition of an additional column (i.e. "packageIdText") where you typecast the original packageID to text.  If you get that working, and create a query entity against that view instead of the table you were originally querying, you should be able to do an "INCLUDES" query on the new text-type column.

Reply
  • 0
    Certified Lead Developer

    The "INCLUDES" operator is intended for comparing text, so it wouldn't be expected to work on integer data (which I assume your "packageID" is).  "IN" should work, but is used for exact matches against an array, i.e. you'd query "IN" and pass in an array i.e. {11, 22, 33}, and any packages with an ID of 11, 22, or 33 (but not "7225") would be returned.

    Assuming I'm correct about packageID's type, and if you really need to do an "INCLUDES" search against it from an interface, for example, then you should be able to create a View that is basically a recreation of that table but with the addition of an additional column (i.e. "packageIdText") where you typecast the original packageID to text.  If you get that working, and create a query entity against that view instead of the table you were originally querying, you should be able to do an "INCLUDES" query on the new text-type column.

Children