Swiftybase
Function StackCommon

Create Struct

Creating a struct type allows you to define a custom type that groups multiple fields together,
making it easier to organize related data and return structured results.

Configuration

To create a struct type, define its shape by specifying fields with their types.
You can also provide an optional JSON tag for each field.

Add the Create Struct function
Create Struct

Define the name of the struct
Define Struct Name

Tap on Add New Field to add fields to your struct
Define New Field


Initialize the Struct

Once the struct type is created, you can create an instance using the Initiate Struct function.
You can optionally pre-fill it with values from existing variables.

Select the struct type
Select Type

(Optional) Pass existing variables to auto-fill each field
For all types (except pointer types), zero values will be used by default.
For example, an empty string for string, or 0 for int.
Fill Struct Field

Once the struct is created, you can:

  • Access and read values from its fields
  • Update individual fields
  • Return the entire struct as a response

Update Struct Field

Get Struct Field

On this page