Validate a Metric having datatype String for Assessment
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2024 03:17 AM
Hi All,
I have a requirement where the datatype of a metric has to store value in HH:MM:SS (duration) for an assessment, though the datatype "Duration" exist, it is not available for assessment. Therefore, I have made use of String datatype but I need to validate that the input is taken in HH:MM:SS format only, if not I need to throw an error to the assessor. Really appreciate any help on this thanks.
For Datatype "String", "Assessment" Available, need to validate input in HH:MM:SS format only
For Datatype "Duration" no "Assessment" Available
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2024 06:39 AM - edited 07-01-2024 06:40 AM
There doesn't seem to be any functionality for input validation in assessments, except for min and max values. So a workaround you could use is to create a separate question for hours, minutes and seconds and apply appropriate min/max restrictions to them. On the server side, you can use a business rule to combine them into one string value if needed or even populate a duration field.
Blog: https://sys.properties | Telegram: https://t.me/sys_properties | LinkedIn: https://www.linkedin.com/in/slava-savitsky/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2024 01:39 AM
Thanks for your response Slava, but again the input value will not be validated before the user submits the assessment which will cause an issue as this field is string even if min max values are modified there are chances the user enters characters instead of numbers. Hence, I want this value to be validated if possible before on Submit of the assessment itself, is there any other workaround / solution to it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2024 06:27 AM
If you set Data type = "Number", the system shouldn't let the users enter non-numeric characters.
Blog: https://sys.properties | Telegram: https://t.me/sys_properties | LinkedIn: https://www.linkedin.com/in/slava-savitsky/