A custom script is a set of instructions written in code to perform a specific task. It helps add logic to a software application when the built-in options do not meet the requirement.
In Quixy, Custom Script is an app event that runs C# code on the server when a selected workflow action takes place. It reads values from form fields, performs the instructions written in the script, and returns the result to mapped form fields.
| Component | Purpose |
|---|---|
| Event Name | Identifies the script in the app's list of events. |
| Workflow Step and Action | Sets the step action that starts the script, for example Start - Submit. You can select more than one. |
| Language | C# is the only language available. |
| Conditions | Run the script every time, or only when the conditions you add are met. |
| Input Field Mapping | Passes form field values to the script as named variables. |
| Output Field Mapping | Writes values from the script into form fields. |
| Custom Script | The C# code that does the work. The editor shows the input variables at the top and a counter for the 10,000-character limit. |
| Code Snippets | Ready-made code for common tasks, such as setting a variable, adding a comment, writing If and Else conditions, and adding, updating, getting or deleting data table records. |
| Check Syntax | Validates the code. The script can be saved only after it returns "No errors found." |
A Custom Script runs when a user performs the workflow step action selected in the event. It runs unconditionally by default. If you add conditions, it runs only when they are met.
Custom Scripts:
string, not DateTime, because a Date field mapped as DateTime produces no output and shows no errorExample Use Case
A leave request form has From Date and To Date fields. A Business Rule can add working days to a date, and a Calculate field can count the days between two dates, but neither counts only the working days between them. When the employee submits the request, a Custom Script counts the days from Monday to Friday in that range and writes the result, for example "10 working days", into the Leave Summary field.