FAQ Q336: What are custom unit properties?
Absatz: Site and resource configuration
Custom unit properties allow you to store any number of values for a specific unit of a resource, or for the resource itself (no unit specified). What is special about unit properties is that each value is set at a specific time point and Planyo keeps the entire history of the values across time. This allows you to implement things such as keeping track of the number of kilometers travelled (odometer reading) or storing physical location of a resource on given dates.
Custom unit property values can be set using the API or
in the backend. You can set a value for any time point: in the past, present or in the future. If you want to set a static value which doesn't change with time (similar to custom resource properties), simply set a single value with a date in the past (at any time before your first reservation in Planyo).
The value of a custom unit property will be printed:
- on the unit properties page
- on the reservation details page (for the rental's start and end times)
- in all your emails, reports and other templates: using the $(unit_property...) tag -- see Q205 in the FAQ. For example, you can use the following tag to calculate the numeric value difference in a custom unit property between the rental end time and start time: $(calc:$(unit_property_unit 1_km count:$(end_timestamp))-$(unit_property_unit 1_km count:$(start_timestamp))). This example will give you the difference for the property named km count and for the unit named unit 1
- you can also use custom unit properties in a pricing manager rule to either adjust the price or set an unavailability error message based on the value
If you're not using unit names (e.g. the quantity of your resource is 1) you can still use custom unit properties instead of custom resource properties whenever you need to simultaneously store different values at different time points.