You want to use the "GetTypeInfo.vi" VI in "LabVIEW 20xx\vi.lib\Utility\VariantDataType\" folder for this!
I would recommend installing this VI Package, as it adds these functions to the palettes:
https://decibel.ni.com/content/groups/hidden-gems-in-vilib
Here's how it looks:

Craig H. | CLA CTA CLED | Applications Engineer | NI Employee 2012-2023