Time Format Validation in Freshservice: A Simple Workaround with Business Rules

As Freshservice consultants, we frequently encounter feature requests for advanced field validations that Freshservice doesn’t natively support. A recent question brought up an interesting use case—how to validate time entries in a text field to follow a specific “hh

” format. Here’s a simple workaround that leverages business rules to partially validate time input.

While this approach isn’t perfect, it does allow for basic checks and can help guide users toward entering time in the desired format. Let’s walk through how to set it up, discuss its limitations, and check out a video demo.

The Challenge: Validating Time Format

Freshservice doesn’t currently offer built-in support for enforcing strict input formats such as time. While it’s often desirable to ensure time is entered as “hh

” for consistency, achieving this in Freshservice takes a little creativity. Ideally, we’d want a solution that prevents users from entering formats other than hours and minutes, separated by a colon.

Unfortunately, advanced regular expressions or strict format validation aren’t currently supported. However, we can set up a basic check for the presence of a colon, which can bring us a step closer to the desired behavior.

The Workaround: Setting Up a Basic Business Rule

Using business rules in Freshservice, we can create a validation rule that checks if the user has included a colon (:) in the text field. Here’s how:

  1. Set Up Your Field: Create a text field for the time entry. To guide users, add instructional placeholder text like “hh

    .” This helps ensure users understand the format you expect.

  2. Create a Business Rule for Validation: Use a business rule to validate the input. Here’s an example rule:

    • Condition: If the time field does not contain a colon (:), show an error message prompting users to reformat their input.

This basic rule enforces a standard, preventing users from entering completely unformatted numbers (e.g., 1230).

For a full demonstration, check out this video where I walk through the setup and discuss the rule in detail: Watch on YouTube.

Limitations of This Approach

While this method offers some validation, there are a few caveats:

  • It’s not foolproof: Users can still input incorrect times like “25:67” or “23:23.” The rule only checks for the presence of a colon, not valid hour and minute values.

  • Date-Time Workflows: If you intend to use this time data in workflows involving date or time-based calculations, you may run into issues. Workflows may need to concatenate this field into a datetime format, which could cause errors if the time is entered incorrectly.

This is by no means a perfect solution, but it’s a quick way to bring some consistency to time entries without needing custom code.

Future Possibilities

It’s possible that Freshservice may introduce more advanced validation options in future updates, allowing users to restrict input formats with greater precision. Until then, workarounds like these can be helpful for IT teams who need quick solutions.

Final Thoughts

For Freshservice admins, business rules provide a flexible way to extend functionality—even when the platform doesn’t fully support your needs. Implementing simple checks like this can improve data quality and ensure better consistency across your service desk.

Have you tried any other workarounds for time validation in Freshservice? Let me know in the comments, and stay tuned for more Freshservice tips!

Previous
Previous

Freshservice Hack: Adding Agent Details to Private Notes in Freshservice Using API Calls

Next
Next

Unpacking the Top Features of Freshservice's October 2023 Release