Form Trigger
Easily build forms that integrate with your favorite APIs, databases, and programming languages, using WayScript.
Build a GUI form and run your script when the form data is submitted.


Title and Description

You can add a title and description to your form to create context for your users.
Once your trigger is activated, you can press the 'View Form' button to be taken to the live, public endpoint for your form. This form can be shared with others you want to use your form.
Form Descriptions support markdown!

Adding Form Inputs

In order to add an input, press + Add a Form Element. You can add as many form elements as you want.
There are four input types you can currently choose from:

1) Text Input

Sample Text Input
Title - There are a few different parts of the element to notice. First, you can create a title for the input (in the example image we are asking 'What is your name?'.
Required - You can set required to On/Off - if on, a user is required to enter an answer before they can submit the form.
Placeholder - This is just placeholder text you can enter for the text input.

2) Text Area

The Text Area element behaves identically to the Text Input element. The key difference is it provides space for a longer form answer.

3) Selector

The Selector element can be used to give users of the form a set of choices to choose from. In order to add options to your selector, press the + Add an Option button. You can add as many options as you want.
Setting up a Selector
Result on the Form

4) Radio Buttons

The Radio element behaves exactly like the Selector element above. The form will render the options as radio buttons.
Radio button example

5) File Upload

The File Upload element allows users to attach and upload a file when submitting your form. You can currently upload PDFs but more general file type support is coming soon.
PDF Upload Example
The File Upload element will output a Struct of the following form:
File = {
filename : String,
bytes : Bytes,
extension : String,
mimetype : String,

Advanced Inputs

CSS - You can customize the CSS of your form for your own look and feel.

View Form

In order to view your live form, make sure your trigger is active and then press the View Form button.
Trigger is On, press View Form

Advanced Settings


When setting up the Form Trigger, you can create as many named endpoints as you like. If you don't provide a name for your endpoint, the trigger will match the root URL. All endpoint names must be unique throughout your script to prevent ambiguity.
To access your endpoints, use the program ID as a subdomain of For example, in the image above, you can trigger your script by hitting either or
Remember to activate your trigger before using the endpoint!

Password-Protect your Form

If you would like your form to require a login to view, enable the "Password Protection" toggle.
A button to "Manage Login Credentials" will appear.
Clicking this button will take you to "Login Credentials" section of the "Script Setup" tab, where you can manage the usernames and passwords that will allow people to log in to your endpoints.
When you click "Add a credential," a new login will be automatically generated for you, including a username and randomly-generated password. You can choose to use these values, or edit them as you see fit.
When a user goes to access your form for the first time, they will now be prompted to login.
The username information of each trigger run will be available in the system global struct , context.
Form Login Prompt

Basic Authentication

If you password-protect your endpoints, you can use the credentials added above to access your endpoints by including an Authorization: Basic header in your request.
This header should follow the standard for HTTP basic access authentication. For example, suppose your Username is "[email protected]" and your Password is "letmein," you would create the Authorization header by:
  1. 1.
    Joining the Username and Password into a single string, separated by a semicolon: [email protected]:letmein
  2. 2.
    Encoding that string in Base64: Y2FwdGFpbkB3YXlzY3JpcHQuY29tOmxldG1laW4=
  3. 3.
    Passing that encoded string to your custom endpoint by including the Authorization: Basic Y2FwdGFpbkB3YXlzY3JpcHQuY29tOmxldG1laW4= header in your request.
These headers are also displayed for you under each password in the "Login Credentials" section of the "Script Setup" tab.
WayScript recommends Authenticating using your API Key, as it is more secure than Basic Authentication.

Authenticating Using Your API Key

If your endpoint is not public, you can also use your WayScript API Key to access your endpoints api call by including an Authorization: Bearer header in your request.
For example, if your WayScript API Key is fhAEdGT9EbFDh_migcrukZ1Vb28rLFKqt9AxOiq9bdQ, you would include the Authorization: Bearer fhAEdGT9EbFDh_migcrukZ1Vb28rLFKqt9AxOiq9bdQ header in your request.


The Form Trigger will output a Struct of the responses to your form.
Form = {
input_1 = 'Answer One',
input_2 = 'Answer Two',

Raw Request Data

The raw form data submitted to the Form Trigger endpoint.