Skip to content

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.
IReadOnlyList<ActionChoice> Choices { get; init; }

The choices of a ActionFieldType.Choice field.

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.

string? Language { get; init; }

Fixed language of a ActionFieldType.Code field: “json”, “xml”, “html”, “text”.

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.

int MaxLength { get; init; }

Longest text (Text, Multiline, Password).

int Min { get; init; }

The smallest value of a ActionFieldType.Number field.

bool OffEdge { get; init; }

The setting of the “When the rule turns off” part.

bool Required { get; init; }

The rule cannot be saved without a value.

ActionFieldType Type { get; init; }

The kind of input.

string? VisibleWhenKey { get; init; }

Shown only while the Choice / Bool field ActionField.VisibleWhenKey has the value ActionField.VisibleWhenValue.

string? VisibleWhenValue { get; init; }

One value, or several separated by “|” (“basic|digest”).

static ActionField Bool(string key, string label, bool defaultValue = false)

A check box.

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.

static ActionField DynamicChoice(string key, string label, bool required = true)

A select whose choices come from IActionPlugin.ListChoicesAsync while the rule is edited.

static ActionField KeyValues(string key, string label)

Name and value rows (headers, query parameters); read them with ActionInvocation.GetPairs.

static ActionField Multiline(string key, string label, bool required = false)

Several lines of text.

static ActionField Number(string key, string label, int min, int max, int defaultValue)

A whole number from min to max.

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.