Hi there,
trying to learn building web api in Appian, could anyone know what's the problem here? the second parameter can not be CASTed?
Best regards,
Discussion posts and replies are publicly visible
found the reason, the "sn" should be "SN" match the definition in data type
Use typeof() function as shown below.
cast( typeof('type!{urn:com:appian:types:AWM}AWM_SN'()), { id: 1, sn: "XXX-XX-123" } )
FYI, No need to use typeof() when referencing a CDT
Agree. The syntax is little bit tricky.
If you use () it means you are referring to empty CDT instance and you need to use typeof(). if you reference directly to the cdt type like 'type!{urn:com:appian:types:AWM}AWM_SN' then no need to use typeof().
cast( typeof('type!{urn:com:appian:types:AWM}AWM_SN'()), { id: 1, sn: "XXX-XX-123" })
Thanks everyone, I have made it work.