Skip to content
CCPEDIAby Unity Nodes
Discussions/App Development/Is there any way to read dynamically the fields of data types / templates?Forum ↗

Is there any way to read dynamically the fields of data types / templates?

App Development2 posts57 viewsLast activity Aug 2024
CO
cohen.avrahamOP
Aug 2024

G-d willing

Hello,
I would like to know how to write a generic function that accepts a data type and prints out the fields’ names and their types.
How can I do this?

Thanks

BE
bernhard
Aug 2024

Hi @cohen.avraham , Daml does not have reflection features of this kind. Even getting the human readable type name of a value is supported only in “dev” versions and for interfaces. See How to get the name of a template or data type.

← Back to Discussions