Tips, Tricks, and Best Practices
This topic provides valuable insights, quick tips, and recommended best practices to help you optimize your usage of tools across our platforms and products. The goal is to improve your efficiency, effectiveness, and overall experience by sharing expert insights and proven methods. The guidance in this topic is grouped based on the applicable product component.
Templates
Convert Time to Quarter-Hour Increments in Smart Flows
In Smart Flows, it’s often helpful to convert timestamps into decimal values based on quarter-hour increments for easier aggregation, billing logic, or standardized formatting. This topic explains a simple method to convert time values into quarter-hour fractions using a formula function within your template builder expressions.
Use Case Scenario
Suppose your flow retrieves timestamps such as 1:15 or 1:20 from a field, and you want to standardize them into decimal hour values such as 1.25. This is particularly useful in contexts like service reporting or billing, where partial hours must be expressed in decimal format.
Expression Logic
Formula Snippet: Convert Minutes to Decimal Hours
concat(
floor(FIELD/60),
formatNumber(FIELD%60/60,".00")
)
What the Formula Does
This formula takes a time value expressed in minutes and breaks it into two parts: the whole number of hours and the fractional remainder expressed as a decimal. This lets you display time in decimal-hour format, which is especially useful for reports, invoices, or calculations that require consistent units.
Function | Description |
---|---|
floor(FIELD/60) | Returns the number of full hours in the value. |
FIELD%60 | Gets the remainder minutes after full hours are removed. |
formatNumber(..., ".00") | Converts the remainder to a decimal and formats it to two decimal places. |
concat(...) | Joins the hour and decimal together into a single string (e.g., 1.25). |
This formula assumes FIELD
is expressed in total minutes (e.g., 1:15 = 75). If your field separates hours and minutes, you may need to first convert the full time into a single minute value before applying this formula.
Example Output
Input Time | Converted Value |
---|---|
1:15 | 1.25 |
1:20 | 1.33 |
1:45 | 1.75 |
Next Step
If you're building Smart Flows for time-sensitive templates or billing logic, consider pairing this formula with conditional formatting to round or validate time blocks.