Skip to main content

Create a custom user input form

Wrk Product avatar
Written by Wrk Product
Updated over a week ago

Create a custom form to get user input. This will generate a link which can be distributed for input. When used with the ‘Wait for a response from a custom user form’ the Wrkflow will wait for a form submission before continuing.

Application

  • User Input Tools - Employee in the Loop

Inputs (what you have)

Name

Description

Data Type

Required?

Example

Form content

HTML of the form data to present to the user. See documentation for configuration details

Text (Long)

Yes

<input type="text" name="username" value="John">
<select name="country">
<option value="Canada" selected>Canada</option>
<option value="USA">USA</option>
</select>

Wait time limit

The amount of time this action should wait for a response in hours. Note the maximum wait time is 7 days (in hours).

Number with decimals

Yes

0.05

Outputs (what you get)

Name

Description

Data Type

Required?

Example

Form ID

ID of the form

Text (Short)

No

Response link

Link to the form

Text (Short)

No

The Wrk Action gathers all input and select elements within the Form content and processes each element individually to build a structured JSON response.

Key Assignment:

Each input field should have a name attribute, which is used as the key in the form response. This requirement ensures that each field has a unique and consistent identifier.

Behaviour for Each Input Type:

  1. Radio Buttons:

    • Only the selected (checked) radio button in each group is included in the form response.

    <!-- Example HTML for Radio Buttons -->
    <input type="radio" name="color" value="red" checked>
    <input type="radio" name="color" value="blue">
    // Resulting JSON 
    { "color": "red" }

  2. Checkboxes:

    • For checkboxes with the same name, all checked values are stored together in an array.

    <!-- Example HTML for Checkboxes -->
    <input type="checkbox" name="hobbies" value="reading" checked>
    <input type="checkbox" name="hobbies" value="sports" checked>
    <input type="checkbox" name="hobbies" value="music">
    // Resulting JSON 
    { "hobbies": ["reading", "sports"] }
  3. Other Input Types (e.g., Text, Select Dropdowns):

    • Each input’s value is stored in the form response under the key specified by the name.

    • Note textareas are not supported

    <!-- Example HTML for Text and Select Dropdown -->
    <input type="text" name="username" value="John">
    <select name="country">
    <option value="Canada" selected>Canada</option>
    <option value="USA">USA</option>
    </select>
    // Resulting JSON 
    {
    "username": "John",
    "country": "Canada"
    }


Outcomes

Name

Description

Success

This status is selected if the job has successfully completed.

Requirements

  • N/A

Did this answer your question?