mirror of
https://github.com/noodlapp/noodl-docs.git
synced 2026-01-11 23:02:54 +01:00
Initial commit
Co-Authored-By: kotte <14197736+mrtamagotchi@users.noreply.github.com> Co-Authored-By: mikaeltellhed <2311083+mikaeltellhed@users.noreply.github.com> Co-Authored-By: Tore Knudsen <18231882+torekndsn@users.noreply.github.com> Co-Authored-By: Michael Cartner <32543275+michaelcartner@users.noreply.github.com>
This commit is contained in:
5
nodes/data/object/_properties.md
Normal file
5
nodes/data/object/_properties.md
Normal file
@@ -0,0 +1,5 @@
|
||||
| Data | Description |
|
||||
| --------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Properties To Set</span> | You can specify which properties to set by adding them to this list. Object don't have a schema with predefined properties like Records so you can choose any property name you want. |
|
||||
| <span className="ndl-data">Property Types</span> | Each property that you want to set will give you the option of setting the type of the value that you want to set to that property. |
|
||||
| <span className="ndl-data">Property Values</span> | <##input:prop-\*##>The value to set on the Object property when the action is performed. (Signal is receieved on the **Do** input)<##input##> Each property that you want to set (that was added to the **Properties to set** section above) will get it's own input both in the property panel and as a connection input. |
|
||||
39
nodes/data/object/create-new-object.md
Normal file
39
nodes/data/object/create-new-object.md
Normal file
@@ -0,0 +1,39 @@
|
||||
---
|
||||
hide_title: true
|
||||
hide_table_of_contents: true
|
||||
title: Create New Object
|
||||
---
|
||||
|
||||
<##head##>
|
||||
|
||||
# Create New Object
|
||||
|
||||
The node can be used to create a fresh new [Object](/nodes/data/object/object-node).
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
You can provide any number of properties with values for your new Object. When the **Done** signal is sent the Object is created and you can perform other actions using the Object.
|
||||
|
||||
<##head##>
|
||||
|
||||
## Inputs
|
||||
|
||||
@include "./_properties.md"
|
||||
|
||||
| Signal | Description |
|
||||
| -------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Do</span> | <##input:do##>Send a signal in this input to create the new Object with the provided properties.<##input##> |
|
||||
|
||||
## Outputs
|
||||
|
||||
| Data | Description |
|
||||
| ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| <span className="ndl-data">Id</span> | <##output:id##>The **Id** of the newly created object, this output is valid only when the **Done** signal has been sent.<##output##> |
|
||||
|
||||
| Signal | Description |
|
||||
| ---------------------------------------- | ----------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Done</span> | <##output:done##>A signal is sent on this output when the Object have been created.<##output##> |
|
||||
70
nodes/data/object/object-node.md
Normal file
70
nodes/data/object/object-node.md
Normal file
@@ -0,0 +1,70 @@
|
||||
---
|
||||
hide_title: true
|
||||
hide_table_of_contents: true
|
||||
title: Object
|
||||
---
|
||||
|
||||
<##head##>
|
||||
|
||||
# Object
|
||||
|
||||
An **Object** is a basic data object in Noodl that stores any amount of properties. It can be used standalone or together with [Array](/nodes/data/array/array-node) and [Repeater](/nodes/ui-controls/repeater) nodes to create lists. An **Object** works much like a [Variable](/nodes/data/variable/variable-node) but it can store many properties in one object.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
The **Object** node is typically used together with the [Create New Object](/nodes/data/object/create-new-object) node and the [Set Object Properties](/nodes/data/object/set-object-properties) node to create a complete object lifecycle, creating and updating object properties.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
<##head##>
|
||||
|
||||
You can also create and refer to an object statically (i.e. not using a [Create New Object](/nodes/data/object/create-new-object) by settings its **Id**. Generally, the **Id** is a global identifyer of the **Object** meaning that any **Object** nodes with the same idea will refer to the same data. If you change the properties in one **Object** node the values of all **Object** nodes with the same **Id** will be changed immediately, unless if you connect the **Fetch** signal.
|
||||
|
||||
## Similarities between Objects and Records
|
||||
|
||||
**Object** and [Record](/nodes/data/cloud-data/record) nodes are very similar. A **Record** can be seen as an **Object** that is backed by a database entry and hence have actions to **Fetch** from and **Store** it in the database. A **Record** also has a database defined schema based on its **Class** which enables Noodl to detect its available properties from its database Class. **Objects** does not have a schema.
|
||||
If needed, you can use the **Id** of a **Record** as the **Id** of an **Object** to access its properties, but obviously cannot use the **Object** to store or fetch the data from the database.
|
||||
|
||||
Generally you use **Objects** as data holder for data that does not need to be stored in a database.
|
||||
|
||||
## Inputs
|
||||
|
||||
### General
|
||||
|
||||
| Data | Description |
|
||||
| --------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Custom Properties</span> | An **Object** node can have any amount of properties. Each property will get one input and output to set/get their current value. |
|
||||
| <span className="ndl-data">Id</span> | <##input:id##>Set the _Id_ for this **Object**. All **Object** nodes with the same _Id_ will refer to the same data and have the same properties.<##input##> Changing a value of any property will immediately update the property in all other **Object** nodes with the same **Id** (unless if you connect the **Fetch** signal to a specific _Object_ node, see below). |
|
||||
|
||||
| Signal | Description |
|
||||
| ----------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Fetch</span> | <##output:fetch##>Normally when an **Object** _Id_ is set, the property outputs are immediately updated. If you want to control how the data is updated you can connect to the _Fetch_ signal input. Then you need to explictly send a signal here for the **Object** node to fetch the data.<##output##> |
|
||||
|
||||
## Outputs
|
||||
|
||||
### General
|
||||
|
||||
| Data | Description |
|
||||
| --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
|
||||
| <span className="ndl-data">Id</span> | <##output:id##>The _Id_ for this **Object** node.<##output##> |
|
||||
| <span className="ndl-data">Custom Properties</span> | An **Object** can have any amount of properties. Each property will get one output to get the current value. |
|
||||
|
||||
| Signal | Description |
|
||||
| ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| <span className="ndl-signal">Changed</span> | <##output:changed##>Signal when any of the properties of this **Object** have changed.<##output##> |
|
||||
| <span className="ndl-signal">Fetched</span> | <##output:fetched##>Signal when the **Object** has fetched and updated it's outputs. Note that the event is triggered no matter if the properties have changed or not.<##output##> |
|
||||
| <span className="ndl-signal">Changed Property Signals</span> | An **Object** will also get changed signal outputs for each of it's properties. They will emit a signal when the property changes value when this or some other **Object** node with the same _Id_ triggers a set. |
|
||||
|
||||
<span className="hidden-props-for-editor"><##output:changed-\*##>Triggered when this user defined property is changed.<##output##></span>
|
||||
|
||||
<span className="hidden-props-for-editor"><##input:prop-\*##>User defined property.<##input##></span>
|
||||
|
||||
<span className="hidden-props-for-editor"><##output:prop-\*##>User defined property.<##output##></span>
|
||||
52
nodes/data/object/set-object-properties.md
Normal file
52
nodes/data/object/set-object-properties.md
Normal file
@@ -0,0 +1,52 @@
|
||||
---
|
||||
hide_title: true
|
||||
hide_table_of_contents: true
|
||||
title: Set Object Properties
|
||||
---
|
||||
|
||||
<##head##>
|
||||
|
||||
# Set Object Properties
|
||||
|
||||
You can use this node to set properties on an [Object](/nodes/data/object/object-node). You must identify the **Object** with it's **Id** (see full docs for details)
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
You can then specify which properties you want to set on the Object in the property panel.
|
||||
|
||||
<div className="ndl-image-with-background">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
Finally, send a signal to **Do** to perform the action.
|
||||
|
||||
<##head##>
|
||||
|
||||
## Inputs
|
||||
|
||||
@include "./_properties.md"
|
||||
|
||||
| Data | Description |
|
||||
| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| <span className="ndl-data">Id Source</span> | An Id of a record is needed to perform the action of this node. The **Id Source** property specifies how this Id is retrieved, the options are:<br/><br/>`Specify explicitly`: This means you need to specify the Id of the record explicitly through e.g. a connection to the **Id** input.<br/>`From repeater`: This means that the Id for the record will be derived from a repeater. This option is only valid if the component this node is placed in is created by a repeater. Then this node will act on the repeater object that this component was created for. |
|
||||
| <span className="ndl-data">Id</span> | <##input:id##>On this input you provide the **Id** of the object where you will set the properties.<##input##> |
|
||||
|
||||
| Signal | Description |
|
||||
| -------------------------------------- | -------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Do</span> | <##input:do##>Send a signal on this input to perform the action and set the properties.<##input##> |
|
||||
|
||||
## Outputs
|
||||
|
||||
| Data | Description |
|
||||
| ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| <span className="ndl-data">Id</span> | <##output:id##>The **Id** of the Object where you will / have set the properties. This is simply a mirror of the **Id** input.<##output##> |
|
||||
|
||||
| Signal | Description |
|
||||
| ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| <span className="ndl-signal">Done</span> | <##output:done##>A signal is sent on this output when the action is performed. You can use this to trigger other actions that needs to run after the properties have been set.<##output##> |
|
||||
Reference in New Issue
Block a user