In order to find the data type of a leaf node dynamically at runtime, you will need to use the schema information as described in the “USING SCHEMA INFORMATION” section of confd_types(3) in the ConfD man-pages. A tree representation of the data model is available through the schema information, which contains a struct confd_cs_node for every node in the data model.
You can also refer to a previous posting that is related to working with the confd_cs_node structure to find its data type for more information.