Skip to main content

6 replies

harshitb6843
February 10, 2023

You can do it like this

recordType!Student(
    recordType!Student.fields.name: local!student.name
)

Just make sure to replace recordType! with your actual record properties. 

abhayd3663
February 10, 2023

Using cast() function.

cast(
  'recordType!{xx-xx-xx-xx-xxx}Employee',
  'type!{urn:com:appian:types:HROB}Employee_CDT'(
    id: 1,
    name: "Abc",
    department: "IT",
    salary: 123,
    age: 25
  )
)

harshitb6843
February 10, 2023

Cast will only work if the keys (field names) of the CDT and the record is exactly the same. 

abhayd3663
February 10, 2023

No need to have the same structure. The cast function will consider all the matching fields and do the conversion. The uncommon fields will be initialize with null. 

Ex.