How to get data from one object, but that object have 2 different types? I have object named 'metric', but 'metric' have 2 different types  