ActionField
Record in Oadm.Sdk.Actions · Oadm.Sdk.dll
One setting of an action. ActionField.Key is the JSON property in the settings; ActionField.Label the form label. ActionField.OffEdge marks a setting that belongs to “When the rule turns off” (shown only for stateful rules).
public sealed record ActionField(string Key, string Label, ActionFieldType Type)Guide: Event rules
Parameters
Key: The JSON property of the setting.Label: The form label.Type: The kind of input.
Properties
Section titled “Properties”Choices
Section titled “Choices”IReadOnlyList<ActionChoice> Choices { get; init; }The choices of a ActionFieldType.Choice field.
Default
Section titled “Default”string? Default { get; init; }Value of a new action (string, number or bool as JSON text, e.g. “5” or “true”); null = empty.
string? Hint { get; init; }Help text below the input.
string Key { get; init; }The JSON property of the setting.
string Label { get; init; }The form label.
Language
Section titled “Language”string? Language { get; init; }Fixed language of a ActionFieldType.Code field: “json”, “xml”, “html”, “text”.
LanguageKey
Section titled “LanguageKey”string? LanguageKey { get; init; }The field whose value is the language of this ActionFieldType.Code field.
int Max { get; init; }The largest value of a ActionFieldType.Number field.
MaxLength
Section titled “MaxLength”int MaxLength { get; init; }Longest text (Text, Multiline, Password).
int Min { get; init; }The smallest value of a ActionFieldType.Number field.
OffEdge
Section titled “OffEdge”bool OffEdge { get; init; }The setting of the “When the rule turns off” part.
Required
Section titled “Required”bool Required { get; init; }The rule cannot be saved without a value.
ActionFieldType Type { get; init; }The kind of input.
VisibleWhenKey
Section titled “VisibleWhenKey”string? VisibleWhenKey { get; init; }Shown only while the Choice / Bool field ActionField.VisibleWhenKey has the value ActionField.VisibleWhenValue.
VisibleWhenValue
Section titled “VisibleWhenValue”string? VisibleWhenValue { get; init; }One value, or several separated by “|” (“basic|digest”).
Methods
Section titled “Methods”static ActionField Bool(string key, string label, bool defaultValue = false)A check box.
Choice
Section titled “Choice”static ActionField Choice(string key, string label, IReadOnlyList<ActionChoice> choices, string? defaultValue = null)A select with fixed choices.
static ActionField Code(string key, string label, string? languageKey = null, bool required = false)A body in the code editor; languageKey names the field whose value is its language.
DynamicChoice
Section titled “DynamicChoice”static ActionField DynamicChoice(string key, string label, bool required = true)A select whose choices come from IActionPlugin.ListChoicesAsync while the rule is edited.
KeyValues
Section titled “KeyValues”static ActionField KeyValues(string key, string label)Name and value rows (headers, query parameters); read them with ActionInvocation.GetPairs.
Multiline
Section titled “Multiline”static ActionField Multiline(string key, string label, bool required = false)Several lines of text.
Number
Section titled “Number”static ActionField Number(string key, string label, int min, int max, int defaultValue)A whole number from min to max.
Password
Section titled “Password”static ActionField Password(string key, string label, bool required = false)A password: stored encrypted and never sent back to a client.
static ActionField Text(string key, string label, bool required = false, string? defaultValue = null)One line of text.