V2/CMS Tutorial/User Tools/Creating Content/Automation/Event/Inputs
From Senfi Docs
Revision as of 10:43, 24 June 2021 by Elysia.Tan (talk | contribs)
Contents
Event Inputs
Event inputs are used to pass information from a triggered expression to the event, and on to the event's action/alarm.
This section explains how the embed formula is used to embed an event's input values into its description and action's content. There are two ways of doing so:
See Embed Node Information to learn how to pass information from a triggered expression to the event inputs.
Embed using the UI
- Select the user-defined input which will be shown in the Click to embed input field (under the message of an event's action/event's description box).
Embed Formula
- Input formula must begin with "${" and end with "}".
- Content enclosed within the brackets consist of 1 to 2 words, separated by ".".
- General: ${<input_name>.<2nd word>}
- 2nd word is used to format the embedded value
Format Values
The CMS supports two types of formatting:
Round
Note:Value of <input_name> must be a number.
- Round values to nearest integer: ${<input_name>.round()}
- E.g. ${asset_id.round()}
Format Date
Note:Value of <input_name> must be a datetime.
Dates are parsed using Moment in UTC mode. Refer to docs here.
You can format using:
-
Organization's default date-time & UTC offset: ${<input_name>.to_date_str()}
- E.g. {date_of_incident.to_date_str()}
-
Specified <preset> format & organization's default UTC offset: ${<input_name>.to_date_str(<preset>)}
- E.g. ${date_of_incident.to_date_str(iso)}
-
Specified <preset> format & <utc_offset>: ${<input_name>.to_date_str(<preset> <utc_offset>)}
- E.g. ${date_of_incident.to_date_str(iso -100)}
-
Specified <format> & <utc_offset>: ${<input_name>.to_date_str(<format> <utc_offset>)}
- E.g. ${date_of_incident.to_date_str('MM/DD/YYYY' -100)}
List of available presets
Preset | Equivalent Format | Sample Output | |
ISO (Year first) | iso | YYYY-MM-DDTHH:mm:ssZ | 1997-07-16T19:20:30+01:00 |
year_first | |||
iso_date | YYYY-MM-DDZ | 1997-07-16+08:00 | |
year_first_date | |||
Day first | day_first | DD-MM-YYYYTHH:mm:ssZ | 16-07-1997T19:20:30+01:00 |
day_first_date | DD-MM-YYYYZ | 16-07-1997+01:00 | |
Month first | month_first | MM-DD-YYYYTHH:mm:ssZ | 07-16-1997T19:20:30+01:00 |
month_first_date | MM-DD-YYYYZ | 07-16-1997+01:00 | |
Time | time | THH:mm:ssZ | T19:20:30+01:00 |
Unix | unix | X | 1360013296 |
unix_ms | x | 1360013296123 |