Types of variables in Server Actions
In the backend, variables are used to transport and manipulate data. We normally use three types of variables in our Server Actions:
- Input variables – These are variables that are outside the context of the action itself and are necessary for the operations to be performed on it. These variables can be defined as mandatory and can be of basic types, identifiers, records, and lists. These variables do not allow defining their default value if they are mandatory:
- Output variables – These variables are, by default, results of processing that takes place within our Server Actions or error handling (if it was successful and any notification message that is necessary). These variables can be of basic types, identifiers, records, and lists. These variables allow the definition of a default value: