🆕get
To return a value of a given field
This function retrieves the value of a field. You can use get
to access fields by their name or ID, making it easy to extract data for use in scripts and calculations.
Syntax
get(nid, string)
Return
text
number
boolean
void
Benefits of get
get
Easy to use: It makes it easy to get data from fields in a consistent way, no matter what type of data it is.
Integration: You can easily use
get
with other functions like set to update and manage data dynamically in your scripts.More flexibility: The
get
function can fetch data using either the field's name or ID, making it easy to work with different field naming styles and database setups.
Using get
can make it easier to access and work with data in Ninox, allowing for efficient data management and easy integration with other functions.
Examples
Here are some simple examples to show how the function works with different inputs.
Return: Vania
Return: true
Return: 42
Return: void
Traditional method
In a typical scenario, in checklist forms field names are often numbered. For example:
Object name 1, Value 1, Date 1
Object name 2, Value 2, Date 2
Object name 3, Value 3, Date 3
To collect all this data and place it into a subtable, you might traditionally use:
The traditional method requires you to specify each object individually. As the number of objects increases, your script grows and becomes more complex. With get
and set, your script stays concise and manageable, regardless of how many objects you have.
Dynamic data collection with get
and set
get
and set
The get
and set functions simplify this process. get
pulls the value from the main record by building the field name dynamically based on the current index. Then, set pulls that value into the matching field in the new subtable record. Here's how you can use it:
See also
set
which updates the value of a given field.
Last updated