Load a Dimension or Exact Dimension in the platform

#1

I have a canonical with a value and a unit and I would like to load them into an ExactDimension.

Currently I am using the following syntax in a canonical transform:

quantity: : ~ expression “{“value”: “value”, “unit”: {“id”: “exists(unit) ? ‘unit’ : null”}}”

Is there a cleaner way to do this?

0 Likes

#2

You should use the function dimensionCreator:

quantity: ~ expression "dimensionCreator(“ExactDimension”, value, unit)"
It will also handle corner cases (undefined value or unit fields) for you

0 Likes