I am getting CastInvalid Error Message . I verified all the datatypes . It looks good. I dont know where this error is pointing.

Expression evaluation error at function a!forEach [line 104]: Error in a!forEach() expression during iteration 1: Expression evaluation error at function 'cast' [line 106]: Could not cast from COSELM_coselm_eox_information to Number (Integer). Details: CastInvalidCould not cast from COSELM_coselm_eox_information to Number (Integer). Details: CastInvalid

  Discussion posts and replies are publicly visible

Parents
  • You don't need the CAST. You can simply have the following:

    a!forEach(
        items: local!productInfo,
        expression: 'type!{urn:com:appian:types:COSELM}COSELM_coselm_eox_information'(
          /* map your attributes from each instance of fv!item to your CDT attributes */
        )
      )

  • Note: if you want to use CAST (which is valid) you need to lose the () suffix from your type! statement i.e.

    a!forEach(
        items: local!productInfo,
        expression: cast(
          'type!{urn:com:appian:types:COSELM}COSELM_coselm_eox_information',
          {
            /* map your attributes from fv!item to your CDT attributes here*/
          }
        )
      )

    This is because the instruction type!'<myType>'() is a function to create an instance of your CDT, whereas type!'<myType' is a reference to the type number, and CAST requires the type number of a type not an instance of the type.

Reply
  • Note: if you want to use CAST (which is valid) you need to lose the () suffix from your type! statement i.e.

    a!forEach(
        items: local!productInfo,
        expression: cast(
          'type!{urn:com:appian:types:COSELM}COSELM_coselm_eox_information',
          {
            /* map your attributes from fv!item to your CDT attributes here*/
          }
        )
      )

    This is because the instruction type!'<myType>'() is a function to create an instance of your CDT, whereas type!'<myType' is a reference to the type number, and CAST requires the type number of a type not an instance of the type.

Children