An error occurred while evaluating expression: EMS_J_PROJECT_MEETING.PROJECT_ID:cast( 'type!{urn:com:appian:types:EMS}EMS_J_PROJECT_MEETING'("PROJECT_ID"), pv!PROJECT_ID ) (Expression evaluation error at function 'cast': Co

while i am trying to map a process variable which is a forigen key in another table, i got an an error saying that  integer cannot be cast into the datatype "EMS_DATATYPE", so i thought to cast it , but my cast is showing the same error ...

this  is the code that i written in scrip task

cast(
  'type!{urn:com:appian:types:EMS}EMS_J_PROJECT_MEETING'("PROJECT_ID"),
  pv!PROJECT_ID
)

and the error is

An error occurred while evaluating expression: EMS_J_PROJECT_MEETING.PROJECT_ID:cast(
   'type!{urn:com:appian:types:EMS}EMS_J_PROJECT_MEETING'("PROJECT_ID"),
   
pv!PROJECT_ID
) (Expression evaluation error at function 'cast': Could not cast from EMS_J_PROJECT_MEETING to Number (Integer). Details: CastInvalid) (Data Outputs)

any suggestions?

  Discussion posts and replies are publicly visible

Parents Reply

  • EMS_J_PROJECT_MEETING.PROJECT_ID: cast(...) looks like you're trying to cast something to be whatever type the PROJECT_ID is.

    Maybe try creating the EMS_J_PROJECT_MEETING object like this...

    EMS_J_PROJECT_MEETING: cast( 'type!{urn:com:appian:types:EMS}EMS_J_PROJECT_MEETING'("PROJECT_ID"),
    {emsJProjectMeetingField: pv!PROJECT_ID}
    )

    where emsJProjectMeetingField would be whatever field in EMS_J_PROJECT_MEETING the pv!PROJECT_ID would map to.


    This should create an EMS_J_PROJECT_MEETING object with the field for emsJProjectMeetingField set to your pv!PROJECT_ID value

    For example, to create a ACME_Object object with the filed for commenter set you would do the following

    local!acmeObject: cast('type!{urn:com:appian:types}ACME_Object',
         {commenter: loggedInUser()}
    ),

Children