How to create a dynamic preferences?

Hi,All:
In my DHT file , when I set a dynamic preference as below:

The content of the dynamic preference needs to be distinguished by the information type of the device. Obviously, when the content of the dynamic preference is initialized, the device information fails to be obtained.
What should i do to achieve this?

state and other static objects are not accessible through the metadata section of a DTH unfortunately.