--- title: "Set flag" slug: "freaction-set-flag" updated: 2026-05-05T11:36:09Z published: 2026-05-05T11:36:09Z canonical: "docs.lobstersoftware.com/freaction-set-flag" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # Set flag *See also:* [Unset flag](/v1/docs/en/freaction-unset-flag), [Working with flags](/v1/docs/en/fre-flags) > [!NOTE] > **Actions – Abstract** > > The [Set flag](/v1/docs/en/freaction-set-flag) action sets the flag specified by the **Flag name** in the context of the form, so that the behavior type [Check flag](/v1/docs/en/frebehav-check-flag), that refers to this flag, returns the check result "true". ![images/download/attachments/189433245/image-2024-10-8_16-13-12-version-1-modificationdate-1728396792666-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2024-10-8_16-13-12-version-1-modificationdate-1728396792666-api-v2.png) The [Set flag](/v1/docs/en/freaction-set-flag) action sets the flag specified by the **Flag name** in the context of the form, so that the behavior type [Check flag](/v1/docs/en/frebehav-check-flag), that refers to this flag, returns the check result "true". If the flag in question was not set before the action was executed, the triggering event [Flag changed](/v1/docs/en/fretrigger-flag-changed) is triggered, so that other behavior can be executed within the form. **NOTE:** Linking an element has no effect on this action. ## Example In a portal that is opened as a modal dialog on request, an "account statement" (a list of all invoices and, if applicable, incoming payments) should be displayed for a customer determined by context when opening the portal. The relevant data series is obtained by a [Tuple search (Form designer)](/v1/docs/en/frebehav-tuple-search) behavior, the results of which are written to a [Repeatable element](/v1/docs/en/fre-duplicate-element-container-vo) that is shown with the "Grid" display type. If there are any irregularities in any row of the displayed "History" regarding payment behavior, a corresponding warning symbol will appear above the list. Runtime example: ![images/download/attachments/189433245/image2020-7-3_13-39-43-version-1-modificationdate-1728395709269-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2020-7-3_13-39-43-version-1-modificationdate-1728395709269-api-v2.png) - The example shows several overdue invoices with incomplete incoming payments. - The relevant validation criteria are primarily checked when each "row" is filled in the [Repeatable element](/v1/docs/en/fre-duplicate-element-container-vo) container. - At the time of the screenshot (06/26/2020), the invoice listed in the first position is not yet due. Therefore the second row appears selected. - For the selected row (in the detail area), the [!] symbol is displayed at the end of the row if there is an irregularity. - If there is an irregularity with at least one row, the "thumbs down" symbol appears in the form header (see image above). Configuration: | ![images/download/attachments/189433245/image-2024-10-8_16-19-29-version-1-modificationdate-1728397169231-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2024-10-8_16-19-29-version-1-modificationdate-1728397169231-api-v2.png) | For the text field "Outstanding", which displays the difference between the "Amount invoiced" and the "Payment receipt", a number of behaviors are configured as shown on the left. The expanded behavior ("alert") is the only one that contain the **Triggering event** and actions, while the other two only provide check results for the [Logical condition](/v1/docs/en/frebehav-logical-check) in the "alert" behavior: - The "overdue" behavior returns "true" if the date the invoice is due is relative to the current date. --- - The "outstanding" behavior returns "true" if there is a "remaining amount" > 0. --- - The "alert" behavior reacts to the **Triggering event** [Changed](/v1/docs/en/fretrigger-changed) with the **Change type** "Value set by program". The behavior therefore becomes active exactly when the calculation result for the "Outstanding" amount is received in a row. --- - The **Behavior type** [Logical condition](/v1/docs/en/frebehav-logical-check) then checks whether the invoice is due and a balance is given. --- - Under the **Actions on "true"**, the [Show element](/v1/docs/en/freaction-show) action initially makes the [!] symbol visible. Afterwards, the [Set flag](/v1/docs/en/freaction-set-flag) is executed with the **Flag name** "paymentAlert". The following behavior for the respective [Image/Icon](/v1/docs/en/fre-image-vo) element is only active for the first irregularity. --- - Under the **Actions on "false"**, only the [Hide element](/v1/docs/en/freaction-hide) ensures that the [!] symbol for an invoice without irregularities does not appear in the details area. | | --- | --- | | ![images/download/attachments/189433245/image-2024-10-8_16-24-44-version-1-modificationdate-1728397483952-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2024-10-8_16-24-44-version-1-modificationdate-1728397483952-api-v2.png) | The "thumbs down" [Image/Icon](/v1/docs/en/fre-image-vo) is set to invisible when opening the form. The "paymentAlert" behavior shown on the left is configured for this element: - The behavior reacts to the **Triggering event** [Flag changed](/v1/docs/en/fretrigger-flag-changed) for the **Flag name** "paymentAlert". Since the default value of a flag is "false" and the form does not provide an action to [Unset flag](/v1/docs/en/freaction-unset-flag), the behavior is executed a maximum of once per "session" with the form, namely when the first irregularity occurs, and the "alert" behavior (see above) sets the "paymentAlter" flag for the first time. --- - Since the flag can only be changed from "false" to "true" in this case, the flag does not have to be examined by the **Behavior type** [Check flag](/v1/docs/en/frebehav-check-flag). Instead, a [Static](/v1/docs/en/frebehav-static) behavior type with the default value "true" is sufficient, since the **Actions on "true"** will be executed unconditionally. --- - Under the **Actions on "true"**, the [Show element](/v1/docs/en/freaction-show) action makes the **Target element** with the name "BAD" visible. This is the executing [Image/Icon](/v1/docs/en/fre-image-vo) element itself. | | ![images/download/attachments/189433245/image-2024-10-8_16-29-20-version-1-modificationdate-1728397760861-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2024-10-8_16-29-20-version-1-modificationdate-1728397760861-api-v2.png) | In addition, the behavior shown on the left is configured for the text input "Outstanding", which sets the focus on "Outstanding" in the first invoice with irregularites, and thus also ensures that its detailed data is immediately visible because the corresponding row is selected: - As a **Triggering event**, [Flag changed](/v1/docs/en/fretrigger-flag-changed) is used again for the same flag "paymentAlert". This flag will only change state once, if at all, because it is not reset until the form is closed. --- - For this reason, the **Behavior type** [Static](/v1/docs/en/frebehav-static) with the default value "true" is used again, since the **Actions on "true"** should be executed. --- - Under the **Actions on "true"**, [Set focus to element](/v1/docs/en/freaction-set-focus) sets the focus to the (executing) **Target element** "Outstanding" in the "row" that displays the data of the first overdue invoice in the list. |