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

Display Form

RCA.Activities.FormBuilder.DisplayForm

Description​

Allows you to design, load, and display a user interface Form based on a pre-defined JSON schema. This is the container activity for the Form Builder package; other form actions (like getting or setting values, enabling/disabling controls) must run dynamically inside this activity's execution block.

display-form

(*For mandatory)

In the body of the activity​

  • Open Form Builder (Button) - Opens the visual, drag-and-drop Form Builder editor to design your form interface and export the JSON schema. For a detailed guide on how to design layouts and configure validation rules in the editor, see the Build your first form documentation.
  • Do - The execution container block. Any activities placed here run asynchronously while the form is open, allowing the robot to dynamically update field values, disable fields, or handle custom events before the user submits or closes the form.

Properties​

Input​

Property NameData TypeRequiredDefaultDescription & User-Centric Guide
Json Schema File NameInArgument<String>YesNoneThe path to the .json schema file generated from the Form Builder tool.
Form ArgumentsDictionary<String, Argument>NoNoneMaps workflow variables directly to form components. Key names must match the Field Keys (Property Names) of the fields. Supported types: String, Int32, Double, Decimal, Float, Boolean, JObject, JArray.
Form Fields Input DataInArgument<String>NoNoneA raw JSON-formatted string to populate form data. If a key is defined in both Form Arguments and here, the value here takes precedence.

Example of where to get this:
1. Read a template .json file using the Read Text File activity and pass the text output variable here.
2. Retrieve a JSON string from a REST API response.
3. Construct a JSON string using an Assign activity: "{""customerName"": ""John Doe"", ""agreement"": true}"

Form Format​

Property NameData TypeRequiredDefaultDescription & User-Centric Guide
Form TitleInArgument<String>No"Form Builder" or "Form Runner"The window title shown to the end-user.
Form WidthInArgument<Int32>No540The width of the form window in pixels.
Form HeightInArgument<Int32>NoAuto-fitThe height of the form window. Automatically adjusts to fit all components if left empty.
Form Position XInArgument<Int32>NoCenterHorizontal distance (pixels) from the top-left corner of the window to the left side of the screen.
Form Position YInArgument<Int32>NoCenterVertical distance (pixels) from the top-left corner of the window to the top of the screen.
Is Minimize On StartInArgument<Boolean>NoFalseIf set to True, the form window minimizes to the taskbar immediately when opened.
Form Icon PathInArgument<String>NoDefault IconThe path to an .ico file to use as the window icon.
Always On TopBooleanNoFalseIf True, keeps the form window focused on top of all other windows.
Form Zoom LevelInArgument<Int32>No100Visual zoom scale percentage (e.g. 120 to enlarge content).

Output​

Property NameData TypeRequiredDescription & User-Centric Guide
Form IdOutArgument<Int32>NoThe process ID (PID) of the active form window. Save this to a variable (e.g. formId) to pass into child activities inside the Do block.
Is DismissedOutArgument<Boolean>NoOutputs True if the user closed the form window using the X button without submitting data, and False if they clicked the submit button.
Selected KeyOutArgument<String>NoThe key/ID of the specific button or component that was clicked to trigger form submission.
Output DataOutArgument<Object>NoA JSON-formatted string representing all data submitted by the user. You can parse this object using JSON activities or direct string manipulation to extract user input.

Common​

Property NameData TypeRequiredDefaultDescription
Continue On ErrorBooleanNoFalseIf True, the workflow continues running even if the form fails to open.
Execute Do Block FirstBooleanNoFalseIf True, executes the activities inside the Do container block exactly once immediately after the form is rendered and ready.
Timeout MSInArgument<Int32>No0 (Infinite)The maximum time (in milliseconds) the form stays open before closing automatically.

Misc​

Property NameData TypeRequiredDefaultDescription
Display NameStringNoDisplay FormName displayed in the workflow designer.
PublicBooleanNoFalseCheck if you want to publish the activity to orchestrator logs (consider security risks if sensitive data is handled).

Step-by-Step Usage​

  1. Add the Activity: Drag the Display Form activity into your Studio workflow canvas.

  2. Link the Schema: In the Json Schema File Name property, enter the path to your form .json file (e.g. "customer_form.json"). If you do not have a schema yet, click Build your first form in the activity body to design one.

  3. Configure the Display Form activity in your sequence.

    a. Select the Display Form activity on your canvas.

    b. At the bottom of akaBot Studio, click the Variables tab and create the following variables:

    • fullName (Variable type: String)
    • email (Variable type: String)
    • phone (Variable type: String)
    • startDate (Variable type: String)
    • department (Variable type: String)
    • employmentType (Variable type: String)

    d. Look at the Properties panel on the right side of the screen.

    e. Under the Input category, click the ... button next to Form Arguments to open the arguments collection window. f. Add the following arguments exactly as shown:

    KeyTypeDirectionValue
    employeeId (the Property Name of the Hidden component)StringIn"EMP-001" (a value to pre-fill into the form)
    fullName (the Property Name of the Text Field component)StringOutfullName
    email (the Property Name of the Email component)StringOutemail
    phone (the Property Name of the Phone Number component)StringOutphone
    department (the Property Name of the Select component)StringOutdepartment
    employmentType (the Property Name of the Radio component)StringOutemploymentType
    startDate (the Property Name of the Date / Time component)StringOutstartDate

    Note: Use In direction to push data from the workflow into the form (pre-fill), and Out direction to capture data entered by the user back into your workflow variables.

  4. Add a Log Message activity below Display Form to log the registration result. Set its Text to: "Registered: " + fullName + " | " + email + " | " + department + " | " + employmentType + " | Start: " + startDate.

Workflow example​

To follow the steps and try out the tutorial yourself, download the sample project here.


Self-Service Troubleshooting​

Design-Time Validation​

  • Symptom: Red exclamation warning icon on the activity in akaBot Studio.
    • Cause: The Json Schema File Name field is empty or contains an invalid path expression.
    • Solution: Ensure you provide a valid path enclosed in double quotes (e.g., "C:\Project\Schemas\Survey.json") or assign it to a valid String variable.

Run-Time Errors​

  • Symptom: FileNotFoundException when running the process.
    • Cause: The path specified in Json Schema File Name does not exist at runtime.
    • Solution: Use relative paths (e.g., Path.Combine(Environment.CurrentDirectory, "Schemas\Survey.json")) to make sure the tệp is located correctly on the execution machine.
  • Symptom: Form displays completely blank or crashes on start.
    • Cause: The schema file contains malformed JSON syntax.
    • Solution: Open the JSON schema file in a text editor and validate it using a JSON linter tool to ensure there are no missing curly braces or double quotes.
  • Symptom: Variables mapped in Form Arguments do not sync.
    • Cause: Key name mismatch. The keys inside the dictionary must match the Property Name under the Field Key tab of the Form Builder component exactly (case-sensitive).
    • Solution: Verify the component names in the Form Builder layout designer.