Skip to content
CCPEDIAby Unity Nodes
App Development

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

2 posts73 viewsLast activity Aug 2024

  1. cohen.avrahamOP

    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

  2. bernhard

    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.