fields:get(key: string, default: string | nil) --string | nil Use this function to get one of the fields that were provided for this block, or ones that were set using {{fields/fields:set}}. If the field is not found, or never set, the second default parameter is provided instead.
-- Either set or don't set the "name" field to alter the behaviour of this example
local name = fields:get("name", "Admin")
print("Hello there " .. name) fields:has(key: string) --boolean Use this function to check if a field exists on this block, or if it was set using {{fields/fields:set}}.
fields:require(key: string) --string Use this function to depend on one of the fields that were provided for this block, or ones that were set using {{fields/fields:set}}. Will throw an error when the field doesn't exist.
fields:set(key: string, value: string) --nil This function can be used to expand the fields that are accessible through the getter functions.
Any fields added through this method are available in the current block and will be removed during the next block's preparation phase.
The main purpose of this function is to expand the amount of fields in a pre-script hook, as there is no real purpose setting them in your actual script code.