Chuyển tới nội dung chính

Enable

RCA.Activities.FormBuilder.Enable

Description​

Enables a previously disabled component (e.g., input field, dropdown, submit button) on an active form window. Once enabled, the component becomes active and fully interactive, allowing the end-user to type, select options, or click buttons. This activity works in tandem with the Disable activity to control user input flows dynamically.

enable


In the body of the activity​

  • Key Name - The unique key name of the form element you want to enable. This value must match the component's Property Name (Field Key) from the Form Builder layout, and must be enclosed in double quotes (e.g., "submit").

Properties​

Input​

Property NameData TypeRequiredDefaultDescription & User-Centric Guide
Form IdInArgument<Int32>YesNoneThe ID of the form target. Bind this to the Form Id output variable generated by the parent Display Form.
Key NameInArgument<String>YesNoneThe target component's Property Name (Field Key). Must be enclosed in double quotes (e.g. "address").

Common​

Property NameData TypeRequiredDefaultDescription
Continue On ErrorBooleanNoFalseIf True, the workflow continues running even if enabling the component fails.

Misc​

Property NameData TypeRequiredDefaultDescription
Display NameStringNoEnableName displayed in the workflow designer.
PublicBooleanNoFalseCheck if you want to publish the activity execution logs.

Step-by-Step Usage​

The Enable activity must run inside the Do block of Display Form because it operates on a live form instance.

For example, to enable a text box ("feedback") only when a checkbox ("provideFeedback") is ticked:

  1. Configure components in Form: In the Form Builder, add a Checkbox component (set Label to Provide Feedback, Property Name under the Field Key tab to provideFeedback, and check Execute DO on change under the Display tab). Add a Text Field component (set Label to Feedback and Property Name under the Field Key tab to feedback).
  2. Assign Form Id: On the Display Form activity, go to the Properties panel, under Output -> Form Id, press Ctrl + K to create a variable named formId (Variable type: Int32).
  3. Get Checkbox Status: Inside the Do block of the Display Form activity, drag a Get Element Value activity:
    • Form Id: formId
    • Key Name: "provideFeedback"
    • Output Data: provideFeedback (Create a variable of type Object)
  4. Check Condition: Below that, drag an If activity:
    • Condition: Convert.ToBoolean(provideFeedback) = True
  5. Enable Text Box: Inside the Then branch (checkbox is ticked), drag an Enable activity:
    • Form Id: formId
    • Key Name: "feedback"
  6. Disable Text Box: Inside the Else branch (checkbox is unticked), drag a Disable activity:
    • Form Id: formId
    • Key Name: "feedback"

Self-Service Troubleshooting​

Design-Time Validation​

  • Symptom: Studio displays a warning that Key Name or Form Id is required.
    • Cause: One of these properties is empty or the Key Name string lacks quotes.
    • Solution: Ensure Key Name is formatted as a string (e.g. "submit") and Form Id is mapped to your Form Id variable.

Run-Time Errors​

  • Symptom: KeyNotFoundException: Component key 'xyz' not found at runtime.
    • Cause: The key passed in Key Name (e.g. "xyz") does not match any Field Key (Property Name) inside the JSON schema file.
    • Solution: Open the JSON schema file in Form Builder, verify the component's Property Name under the Field Key tab, and update the Key Name to match it exactly (case-sensitive).
  • Symptom: ArgumentException: Form ID does not exist.
    • Cause: The form is already closed.
    • Solution: Ensure this activity is executed within the boundaries of the Do block execution loop.