Setting Colors with Date Function Expressions
Manage how your status board warnings are displayed based on time passed or time left. For example you may have a volunteer or employee that forgot check back into the incident via the Incident Management account. Another example is you have a piece of equipment that needs to be checked on every 10 hours, but no-one has had time to check it in the last day.
For these types of status boards, we have functions to automatically turn the row into warning or danger mode, without any action from the user.
Item date function expressions allow you to specify what color a row within a status board should be based on what is entered into a date and time field.
🔑 ACCESS LEVEL: Account Owner
ℹ️ NOTE: You must set colors with status expressions first within the admin area on web application.
- isToday - is the date same date as todays date? Gives true / false
- isTomorrow - is the date same date as tomorrow? Gives true/false
- hoursSince - how many hours since this date/time happened (negative => date is in the future). Gives a number. Needs to be compared against a limit number.
- daysSince - how many days since this date/time happened (same thing with negative). Gives a number. Needs to be compared against a limit number.
⚠️ ATTENTION: If you do not already have a date and time field, you will need to add one first.
To do this:
- Go to the Admin Area
- Expand Templates
- Select Status Boards
- Click the Edit icon on the status board you wish to edit
- Select the Kabob menu at the top right of the field and take note of the field ID, in the example below it is check_in_time
- Scroll down and select +Advanced Options
- Enter in the applicable Item Status Expressions based on the desired colors including the time frame requirements
Example for Using this Expression
An organization may create status boards to help track the checks of generators on a 4 hour bases during an incident to ensure good operating order.
The organization's desire is to visualize the Success, Warning and Danger colors indicated when a generator is past its' check in requirement. Additionally, this organization has also created a status option selection field to indicate if during the check the generator was found Operational or Not Operational.
If status is operational, and it has been check in the last 4 hours, show green. Enter in the following:
- status === 'op' && (data_checked | hoursSince) < 4
If status is operational, and has not been checked in the last 4 hours, show orange. Enter in the following:
- status === 'op' && (data_checked | hoursSince) >= 4
If status is not operational, or it has not been checked in 24 hours, show red. Enter in the following:
- status === 'not_op' || (data_checked | hoursSince) >= 24
ℹ️ NOTE: The following image is based on the Last Checked since it's 14:58 and the Status field