Name property

SwitchField.Name — Text

The name, as assigned in Calcapp Creator.

Field names are normally assigned automatically by Calcapp Creator based on their labels, though a name can be provided manually as well.

Providing names manually makes it possible to find all switch fields matching a certain naming pattern through properties like SwitchFields of form screens. Below, an example returns whether all switch fields in the app, whose names include the text string "Optional", have been toggled to their "on" positions.

Examples

TEXTJOIN(", ", FALSE, App.SwitchFields.Name)TEXTJOIN(", "; FALSE; App,SwitchFields,Name)

Returns a comma-separated text string containing the names of all switch fields of the app.

AND(FILTER(App.SwitchFields, CONTAINS(App.SwitchFields.Name, "Optional")))AND(FILTER(App,SwitchFields; CONTAINS(App,SwitchFields,Name; "Optional")))

Returns whether all switch fields in the app, whose names include the text string "Optional", have been toggled to their "on" positions. The AND function is looking for an array of logical values, which the switch fields provide through their values. AND only returns TRUE if the logical array only contains TRUE elements.

LET(OptionalFields := FILTER(App.SwitchFields, CONTAINS(App.SwitchFields.Name, "Optional")), TEXTJOIN(NEWLINE(), FALSE, OptionalFields.Label & " — " & OptionalFields.Value))LET(OptionalFields := FILTER(App,SwitchFields; CONTAINS(App,SwitchFields,Name; "Optional")); TEXTJOIN(NEWLINE(); FALSE; OptionalFields,Label & " — " & OptionalFields,Value))

Returns a text string containing the labels and values of all switch fields whose names include the text string "Optional". Labels and values are separated from one another with hyphens, and fields are separated from one another with line breaks.