Skip to main content
March 30, 2022
Question

Interface display error.

  • March 30, 2022
  • 11 replies
  • 0 views

Hi,

Seeing the following error:

Could not display interface. Please check definition and inputs. Interface Definition: Expression evaluation error in rule 'adv_getaddresses' at function 'type!{urn:com:appian:types:ADV}ADV_Address' (invalid) [line 23]: Invalid function 'type!{urn:com:appian:types:ADV}ADV_Address' due to invalid type

a!localVariables(
  local!locationsList: rule!ADV_getAddresses(addressId:NULL),
{
  a!sectionLayout(
    label: "Address",
    contents: {
      a!radioButtonField(
        label: "Radio Buttons",
        labelPosition: "COLLAPSED",
        choiceLabels:
            a!forEach(
              items: local!locationsList,
              expression: fv!item.shippingAddress  & " " & 
              if(isnull(fv!item.unitNumber), null,"Unit#"& fv!item.unitNumber)
              & " " & fv!item.city & " , " & fv!item.stateOrProvince
              & " " & fv!item.postalCode
             ),
        choiceValues: local!locationsList,
        saveInto: {},
        choiceLayout: "STACKED",
        validations: {}
      )
    }
  )
}
)

It calls an Expression Rule, which is as following:

a!localVariables(
  local!queryResults: a!queryEntity_18r3(
    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
  )
)

What could be the issue in the code?  Pls kindly help!!

Thanks,
Suneetha.

    11 replies

    mathieud0001
    Brainy
    March 30, 2022

    Says that you have an invalid type.

    Are you sure that the ADV_Address type exists? Perhaps the namespace could be the issue?

    'type!{urn:com:appian:types:ADV}ADV_Address'()

    March 31, 2022

    Yes, ADV_Address type exists..

     

    stefanhelzle0001
    Brainy
    March 31, 2022

    The names are case sensitive. This is ADV_address vs. ADV_Address.

    gopalk2865
    Participating Frequently
    March 31, 2022

    Hi suneethag0001, Please make sure you are casting your data into a valid cdt. Check your query output data and cast them in a matching data type. I hope it helps.

    mikes0011
    Brainy
    March 31, 2022

    Secondary to what the others here have said - the rule doesn't need to use the typeof( {type!...} ) in the CAST() function.  This works but there's a much cleaner way of doing the same code.

    Insetead you can just use the type! directly - by removing the parentheses from the end and adding "?list" -- like the following:

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

    The Expression Guru