Skip to main content
February 19, 2022
Question

Using cast() to array of local variables

  • February 19, 2022
  • 2 replies
  • 0 views

Hi,

Below is the code which I used from Appian exercise, which should return all the 3 data from the data store stored in local variable but it is returning on 1 data

a!localVariables(
local!queryResults:
a!queryEntity(
entity: cons!ADV_DSE_ADDRESS,
query: a!query(
paginginfo: a!pagingInfo(1,-1),
logicalexpression: a!queryLogicalExpression(
operator: "AND",
ignorefilterswithemptyvalues: true(),
filters: a!queryFilter(
field: "addressId",
operator: "in",
value: ri!addressId
)
)
)
).data,
cast(
typeof('type!{urn:com:appian:types:ADV}ADV_address'()),
local!queryResults)
)

Expected: It should return all the data in the local variable.

Please guide what changes to be done in the code to get all data that is stored in local variable

    2 replies

    stefanhelzle0001
    Brainy
    February 19, 2022

    Add the "?list" suffix to your type. Also, reference the type directly instead of creating a data structure of the type and then detect the type of it.

    cast(
      'type!{urn:com:appian:types:ADV}ADV_address?list',
      local!queryResults
    )
    

    February 19, 2022

    Thank You.