Set Value — Reference
Evaluate a value and make it available to later server steps.
Evaluate a value and make it available to later server steps.
Before you begin
Section titled “Before you begin”- An open Server Connect action. Runtime differences below refer to the installed Node.js and PHP implementations.
Set Value
Section titled “Set Value”Evaluate a value and make it available to later server steps.
Settings and execution
Section titled “Settings and execution”| Setting | Meaning |
|---|---|
| Name | Stores the returned value under this step name in the current action scope. For example, greeting becomes available as greeting to later expressions. |
| Global Name | Also writes the value to a named key in the action’s global scope. For example, counter lets a loop update a shared counter. This is request/action scope, not persistent storage shared by all users. |
| Value | The literal or server expression to evaluate. For example, a literal Hello from Server Connect returns that string; a numeric expression returns its evaluated result. |
| Data Type | Describes the result to the editor’s data picker. Choosing Number does not cast a string to a number at runtime. The runtime returns the evaluated Value; use an expression with the intended type. |
| Define Schema | Describes fields of an Array or Object for the picker. It does not validate, create or reshape those fields at runtime. |
| Output | Includes the named result in the response data. Default off. The result remains available to later server steps without Output. |
Worked example
Section titled “Worked example”Add Set Value with Name greeting, Value Hello from Server Connect and Output on. Running the action should return {“greeting”:“Hello from Server Connect”}. Change the literal and rerun to confirm that this step supplies the response.
Check the behavior and limits
Section titled “Check the behavior and limits”Check the actual response type as well as its value. Selecting Number in Data Type while returning the string “12” does not guarantee a numeric 12. Global Name is not a database write or a session value.
Continue with a task
Section titled “Continue with a task”Use the Server Connect guides when you need the surrounding project, data-loading or form procedure.
Check your result
Section titled “Check your result”You can configure Set Value deliberately and verify the result and failure behavior described in this reference.