Skip to main content
December 11, 2025
Solved

How to dynamically cast a stored Record Type name/UUID/string to a Record Type object in Appian?

  • December 11, 2025
  • 5 replies
  • 0 views

We have a database table where we store a reference to a Record Type (it could be the Record Type name, UUID, or a string like "()"). The requirement is to convert this stored value into an actual Record Type object at runtime so that it can be used in expressions or interfaces.

For example:

cast(
272,
" 'recordType!{b12345-12345-12345-12345-c12345}ABC' "

)

Is there any built-in function or best practice in Appian to achieve this dynamic casting?

Best answer by mikes0011

OK, this took me far too much trying different things and failing to come up with such a simple answer.  Embarrassing.

So here it is:  You can get the type ID of an individual record type by wrapping it in "toInteger".  You can cast a value/dictionary into that record type by using that integer as the type in "cast()".  Simple as that, it seems.  I expect (but have not tested) that the RecordType's ID is environment-specific, but that should be easy to get around.

5 replies

mikes0011
mikes0011Answer
Brainy
December 11, 2025

OK, this took me far too much trying different things and failing to come up with such a simple answer.  Embarrassing.

So here it is:  You can get the type ID of an individual record type by wrapping it in "toInteger".  You can cast a value/dictionary into that record type by using that integer as the type in "cast()".  Simple as that, it seems.  I expect (but have not tested) that the RecordType's ID is environment-specific, but that should be easy to get around.

December 11, 2025
[mention:b45a4f6a20b14a008e4e0ec732a8bf98:e9ed411860ed4f2ba0265705b8793d05]  -  Thanks for sharing the details! The only concern here is that the type ID for a Record Type varies across environments, which makes managing this approach risky. If there’s a way to achieve the same functionality using the Record Type’s UUID instead, that would be a much safer and more reliable solution.
stefanhelzle0001
December 11, 2025

Why do you need any kind of ID or UUID to cast data? You can use the type reference.