mirror of
https://github.com/noodlapp/noodl-docs.git
synced 2026-01-11 14:52: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:
97
nodes/data/array/array-filter.md
Normal file
97
nodes/data/array/array-filter.md
Normal file
@@ -0,0 +1,97 @@
|
||||
---
|
||||
hide_title: true
|
||||
hide_table_of_contents: true
|
||||
title: Array Filter
|
||||
---
|
||||
|
||||
<##head##>
|
||||
|
||||
# Array Filter
|
||||
|
||||
This node will take an array of items as input and output a filtered version of the items. Look at the Filter section below to find information on how to create filters.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
<##head##>
|
||||
|
||||
## Inputs
|
||||
|
||||
### General
|
||||
|
||||
| Data | Description |
|
||||
| ------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Enabled</span> | <##input:enabled##>The filtering is enabled by default, if disabled the array will simply pass through unfiltered.<##input##> |
|
||||
| <span className="ndl-data">Items</span> | <##input:items##>The array that should be filtered.<##input##> |
|
||||
| <span className="ndl-data">Use Limit</span> | <##input:filterEnableLimit##>Enables or disables limiting the number of objects in the outputted items array.<##input##> |
|
||||
| <span className="ndl-data">Limit</span> | <##input:filterLimit##>Specify the maximum number of objects in the filtered output.<##input##> |
|
||||
| <span className="ndl-data">Skip</span> | <##input:filterSkip##>Specify the number of objects to skip from the beginning of the filtered output.<##input##> |
|
||||
|
||||
| Signal | Description |
|
||||
| ------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Filter</span> | <##input:filter##>By default the node will filter as soon as there is a new array on the _Items_ input or if that array changes. But if there is a connection to the _Filter_ input it will wait until a signal is sent here to perform the filtering.<##input##> |
|
||||
|
||||
### Filter
|
||||
|
||||
By default the **Array Filter** node will pass through all objects of the input array. You can filter on **Object** properties. Add which properties you want to filter on.
|
||||
|
||||
<div className="ndl-image-with-background">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
For each filter property you can specify:
|
||||
|
||||
**Type**
|
||||
The type you want for the filter, can be _Number_, _String_ or _Boolean_.
|
||||
|
||||
**Op**
|
||||
The available operations of the filter depend on the type that is set.
|
||||
|
||||
- _Equals_ Include in filter if the property equals the provided value. Available for all types.
|
||||
- _Not Equals_ Include in filter if the property does NOT equal the provided value. Available for all types.
|
||||
- _Greater than_ Include in filter if the property is greater than the provided value. Only available if type is _Number_.
|
||||
- _Less than_ Include in filter if the property is less than the provided value. Only available if type is _Number_.
|
||||
- _Greater than or equal_ Include in filter if the property is greater than or equal to the provided value. Only available if type is _Number_.
|
||||
- _Less than or equal_ Include in filter if the property is less than or equal to the provided value. Only available if type is _Number_.
|
||||
- _Matches Regexp_ Match a regexp to the provided value. Available if type is _String_
|
||||
|
||||
?> To perform a free text search on strings, use the _Matches Regexp_ operation and set the _Value_ to the partial string you want to search for.
|
||||
|
||||
**Value**
|
||||
<##input:filterFilterValue-\*##>The value used to test against in the filter operation.<##input##>
|
||||
|
||||
<div className="ndl-image-with-background">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
### Sort
|
||||
|
||||
By default the **Array Filter** node does not sort the output, it will be in the same order as the input. You can specify sorting. Like filters you simply add which properties you want to sort on.
|
||||
For each property you can choose the sorting order.
|
||||
|
||||
<div className="ndl-image-with-background">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
## Outputs
|
||||
|
||||
### General
|
||||
|
||||
| Data | Description |
|
||||
| ----------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Items</span> | <##output:items##>The filtered and sorted array.<##output##> |
|
||||
| <span className="ndl-data">Count</span> | <##output:count##>The number of objects in the filtered array.<##output##> |
|
||||
| <span className="ndl-data">First Item Id</span> | <##output:firstItemId##>The _Id_ of the first object in the filtered array, or _undefined_ if there are no items in the filtered array.<##output##> |
|
||||
|
||||
| Signal | Description |
|
||||
| -------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Filtered</span> | <##output:filtered##>Signal emitted when the array has been filtered, either due to a _Filter_ signal sent or if the array has changed.<##output##> |
|
||||
62
nodes/data/array/array-map.md
Normal file
62
nodes/data/array/array-map.md
Normal file
@@ -0,0 +1,62 @@
|
||||
---
|
||||
hide_title: true
|
||||
hide_table_of_contents: true
|
||||
title: Array Map
|
||||
---
|
||||
|
||||
<##head##>
|
||||
|
||||
# Array Map
|
||||
|
||||
This node takes an input array, runs a small map script on each item, and outputs the resulting mapped array. That is an array with new objects, each created in the mapping script.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
<##head##>
|
||||
|
||||
## Inputs
|
||||
|
||||
| Data | Description |
|
||||
| --------------------------------------- | ------------------------------------------------------------ |
|
||||
| <span className="ndl-data">Items</span> | <##input:items##>The array that should be mapped.<##input##> |
|
||||
|
||||
### Script
|
||||
|
||||
The mapping script used to map the objects in the input array to new objects in the mapped output array. The script should be provided in the following format:
|
||||
|
||||
```javascript
|
||||
map({
|
||||
FullName: () => object.first_name + object.last_name,
|
||||
Age: 'years_old',
|
||||
})
|
||||
```
|
||||
|
||||
You can either provide a string with the name of the property that should be mapped with the syntax _to:'from'_ which will simply rename a property taking the value directly from the input object. Or you can provide a mapping function that takes the object (of the type [Noodl.Object](/javascript/reference/object)) and the function should return the mapped value.
|
||||
|
||||
Sometimes you need to extract the **Id** of the objects you are mapping, this can be done in the following way:
|
||||
|
||||
```javascript
|
||||
map({
|
||||
Value: () => object.getId(),
|
||||
Label: 'PhotoName',
|
||||
})
|
||||
```
|
||||
|
||||
Note that the objects that are created when mapping are new objects so they will have their own Id as well.
|
||||
|
||||
## Outputs
|
||||
|
||||
### General
|
||||
|
||||
| Data | Description |
|
||||
| --------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Items</span> | <##output:items##>The mapped array.<##output##> |
|
||||
| <span className="ndl-data">Count</span> | <##output:count##>The number of items in the mapped array (this will be the same as the input array)<##output##> |
|
||||
|
||||
| Signal | Description |
|
||||
| ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Changed</span> | <##output:changed##>A signal is emitted here when the input array has been modified which will trigger the _Array Map_ node to remap the input and produce a new output _Items_.<##output##> |
|
||||
46
nodes/data/array/array-node.md
Normal file
46
nodes/data/array/array-node.md
Normal file
@@ -0,0 +1,46 @@
|
||||
---
|
||||
hide_title: true
|
||||
hide_table_of_contents: true
|
||||
title: Array
|
||||
---
|
||||
|
||||
<##head##>
|
||||
|
||||
# Array
|
||||
|
||||
Arrays are ordered lists of [Object](/nodes/data/object/object-node)s. See the guide on arrays [here](/docs/guides/data/arrays) for a more detailed introduction.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
You can create and modify the array using the [Create new Array](/nodes/data/array/create-new-array), [Insert Object Into Array](/nodes/data/array/insert-into-array) and [Remove Object From Array](/nodes/data/array/remove-from-array).
|
||||
<##head##>
|
||||
|
||||
## Inputs
|
||||
|
||||
### General
|
||||
|
||||
| Data | Description |
|
||||
| --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Items</span> | <##input:items##>This input sets the source of the array.<##input##> You can for instance forward the content of a [Static Array](/nodes/data/array/static-array) node using this input. The content of the source array will be copied to this array by default and any changes to the source array will also be copied automatically. You can control this by making a signal connection to _Set_, in that case the items, i.e. content of the source array, will only be copied when a signal is received on _Set_. |
|
||||
| <span className="ndl-data">Id</span> | <##input:id##>This is the _Id_ of the array, it works similair to objects and variables. It specifies the array that this node will act on via it's _Id_. All **Array** nodes with the same _Id_ will refer to the same array of objects.<##input##> |
|
||||
|
||||
| Signal | Description |
|
||||
| ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| <span className="ndl-signal">Fetch</span> | <##input:fetch##>Normally when _Id_ is set, the items and count outputs are immediately updated with the content of the array referenced by the _Id_. 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 **Array** node to fetch the data. Before an array have been fetched none of the modify and set operations or source items will have any affect.<##input##> |
|
||||
|
||||
## Outputs
|
||||
|
||||
| Data | Description |
|
||||
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Id</span> | <##output:id##>The _Id_ for this **Array**.<##output##> |
|
||||
| <span className="ndl-data">Items</span> | <##output:items##>This is an output that can be connected to others that can take **Array** inputs, such as the [Repeater](/nodes/ui-controls/repeater) node. It will hold an `Noodl.Array` type.<##output##> |
|
||||
| <span className="ndl-data">Count</span> | <##output:count##>The number of items in the **Array**.<##output##> |
|
||||
|
||||
| Signal | Description |
|
||||
| ------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Changed</span> | <##output:changed##>This signal is triggered when the content of the array is changed, either by an action on this node or by some other node in the graph that operates on the same array Id.<##output##> |
|
||||
| <span className="ndl-signal">Fetched</span> | <##output:fetched##>Triggered when a _Fetch_ action has been performed and the data is ready.<##output##> |
|
||||
35
nodes/data/array/clear-array.md
Normal file
35
nodes/data/array/clear-array.md
Normal file
@@ -0,0 +1,35 @@
|
||||
---
|
||||
hide_title: true
|
||||
hide_table_of_contents: true
|
||||
title: Clear Array
|
||||
---
|
||||
|
||||
<##head##>
|
||||
|
||||
# Clear Array
|
||||
|
||||
This node is used to remove all _Objects_ from an _Array_. The Array is referred to through their _Id_. Use the _Do_ action to remove all _Objects_ in the Array.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
<##head##>
|
||||
|
||||
## Inputs
|
||||
|
||||
| Data | Description |
|
||||
| ------------------------------------------ | ------------------------------------------------------------------------------ |
|
||||
| <span className="ndl-data">Array Id</span> | <##input:collectionId##>The _Id_ of the Array that will be cleared.<##input##> |
|
||||
|
||||
| Signal | Description |
|
||||
| -------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Do</span> | <##input:do##>This actions removes all the Objects from the Array with the _Id_ set on the input _Array Id_.<##input##> |
|
||||
|
||||
## Outputs
|
||||
|
||||
| Signal | Description |
|
||||
| ---------------------------------------- | ------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Done</span> | <##output:done##>This event is sent when the removal is done, and the Array is empty.<##output##> |
|
||||
39
nodes/data/array/create-new-array.md
Normal file
39
nodes/data/array/create-new-array.md
Normal file
@@ -0,0 +1,39 @@
|
||||
---
|
||||
hide_title: true
|
||||
hide_table_of_contents: true
|
||||
title: Create New Array
|
||||
---
|
||||
|
||||
<##head##>
|
||||
|
||||
# Create New Array
|
||||
|
||||
Creates a new Array. The outgoing property _Id_ is the id of the newly created array. This can for example be connected to an [Array](/nodes/data/array/array-node) node or [Insert Object Into Array Node](/nodes/data/array/insert-into-array).
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
<##head##>
|
||||
|
||||
## Inputs
|
||||
|
||||
| Data | Description |
|
||||
| --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Items</span> | <##input:items##>An array containing initial items of the new array. It will be read when the _Do_ signal is triggered. In other words, the new Array will be a copy of the provided Array, containing the same Objects.<##input##> |
|
||||
|
||||
| Signal | Description |
|
||||
| -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Do</span> | <##input:do##>Sending a signal to this input creates the new Array. The _Id_ of the newly created array will be set on the _Id_ output. Each triggering will create a new Array, hence changing the _Id_ output.<##input##> |
|
||||
|
||||
## Outputs
|
||||
|
||||
| Data | Description |
|
||||
| ------------------------------------ | ---------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Id</span> | <##output:id##>The Id of the newly created Array. You use this Id to refer to the Array.<##output##> |
|
||||
|
||||
| Signal | Description |
|
||||
| ---------------------------------------- | ------------------------------------------------------------------------------------------ |
|
||||
| <span className="ndl-signal">Done</span> | <##output:done##>This signal will be sent when the new Array has been created.<##output##> |
|
||||
36
nodes/data/array/insert-into-array.md
Normal file
36
nodes/data/array/insert-into-array.md
Normal file
@@ -0,0 +1,36 @@
|
||||
---
|
||||
hide_title: true
|
||||
hide_table_of_contents: true
|
||||
title: Insert Into Array
|
||||
---
|
||||
|
||||
<##head##>
|
||||
|
||||
# Insert Object Into Array
|
||||
|
||||
This node is used to insert an _Object_ into an _Array_. Both the Array and the Object are referred to through their _Id_. The insert happens when the _Do_ action is triggered.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
<##head##>
|
||||
|
||||
## Inputs
|
||||
|
||||
| Data | Description |
|
||||
| ------------------------------------------- | ----------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Array Id</span> | <##input:collectionId##>The _Id_ of the Array to insert the Object into.<##input##> |
|
||||
| <span className="ndl-data">Object Id</span> | <##input:modifyId##>The _Id_ of the Object to insert into the Array.<##input##> |
|
||||
|
||||
| Signal | Description |
|
||||
| -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Do</span> | <##input:do##>Sending a signal to this input inserts the Object with the _Id_ set on the input _Object Id_ into the Array with the _Id_ set on the input _Array Id_.<##input##> |
|
||||
|
||||
## Outputs
|
||||
|
||||
| Signal | Description |
|
||||
| ---------------------------------------- | ----------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Done</span> | <##output:done##>This signal is sent when the insertion is ready.<##output##> |
|
||||
37
nodes/data/array/remove-from-array.md
Normal file
37
nodes/data/array/remove-from-array.md
Normal file
@@ -0,0 +1,37 @@
|
||||
---
|
||||
hide_title: true
|
||||
hide_table_of_contents: true
|
||||
title: Remove From Array
|
||||
---
|
||||
|
||||
<##head##>
|
||||
|
||||
# Remove Object From Array
|
||||
|
||||
This node is used to remove an _Object_ from an _Array_. Both the Array and the Object are referred to through their _Id_. The removal happens when the _Do_ action is triggered.
|
||||
If the _Object_ to be removed is not in the array, nothing will happen.
|
||||
|
||||
<div className="ndl-image-with-background">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
<##head##>
|
||||
|
||||
## Inputs
|
||||
|
||||
| Data | Description |
|
||||
| ------------------------------------------- | ----------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Array Id</span> | <##input:collectionId##>The _Id_ of the Array from which the Object will be removed.<##input##> |
|
||||
| <span className="ndl-data">Object Id</span> | <##input:modifyId##>The _Id_ of the Object to remove from the Array.<##input##> |
|
||||
|
||||
| Signal | Description |
|
||||
| -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Do</span> | <##input:do##>This actions removes the Object with the _Id_ set on the input _Object Id_ from the Array with the _Id_ set on the input _Array Id_.<##input##> |
|
||||
|
||||
## Outputs
|
||||
|
||||
| Signal | Description |
|
||||
| ---------------------------------------- | -------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Done</span> | <##output:done##>This signal is sent when the removal is done.<##output##> |
|
||||
62
nodes/data/array/static-array.md
Normal file
62
nodes/data/array/static-array.md
Normal file
@@ -0,0 +1,62 @@
|
||||
---
|
||||
hide_title: true
|
||||
hide_table_of_contents: true
|
||||
title: Static Array
|
||||
---
|
||||
|
||||
<##head##>
|
||||
|
||||
# Static Array
|
||||
|
||||
Store static data to populate an [Array](/nodes/data/array/array-node) with items. The Static Array node is great for providing static local data for lists etc. You can use it e.g. as an input to a **For Each** node.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
You can provide the data in either **CSV** format or, **JSON** format. The **items** output is of **Noodl.Array** format. The content of the array is reset whenever the application is refreshed.
|
||||
<##head##>
|
||||
|
||||
## Inputs
|
||||
|
||||
| Data | Description |
|
||||
| -------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Type</span> | Choose what format the data will be in.<br/><br/>`CSV`: Comma-separated values<br/>`JSON`: JavaScript Object Notation |
|
||||
|
||||
### CSV
|
||||
|
||||
The first row defines the name of all properties. Subsequent rows defines the data values.
|
||||
Example:
|
||||
|
||||
lamp,topic
|
||||
Kitchen Lamp,/lamps/1
|
||||
Office Lamp,/lamps/2
|
||||
Office Lamp 2,/lamps/4
|
||||
|
||||
### JSON
|
||||
|
||||
Define the name of the properties, and the data, using a JSON array.
|
||||
Example:
|
||||
|
||||
[
|
||||
{
|
||||
"lamp": "Kitchen Lamp",
|
||||
"topic": "/lamps/1"
|
||||
},
|
||||
{
|
||||
"lamp": "Office Lamp",
|
||||
"topic": "/lamps/2"
|
||||
},
|
||||
{
|
||||
"lamp": "Office Lamp 2",
|
||||
"topic": "/lamps/4"
|
||||
}
|
||||
]
|
||||
|
||||
## Outputs
|
||||
|
||||
| Data | Description |
|
||||
| --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Items</span> | <##output:items##>A `Noodl.Array` object that can be connected to e.g. an [Array](/nodes/data/array/array-node), [JavaScript](/docs/guides/business-logic/javascript) or [Repeater](/nodes/ui-controls/repeater).<##output##> |
|
||||
47
nodes/data/boolean.md
Normal file
47
nodes/data/boolean.md
Normal file
@@ -0,0 +1,47 @@
|
||||
---
|
||||
hide_title: true
|
||||
hide_table_of_contents: true
|
||||
title: Boolean
|
||||
---
|
||||
|
||||
<##head##>
|
||||
|
||||
# Boolean
|
||||
|
||||
This node holds a <span className="ndl-data">boolean</span> (true/false) value. You can use it to quickly store a <span className="ndl-data">boolean</span> using the <span className="ndl-signal">Set</span> input. It can also be used to hold a static value in logical operations.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
You can connect the <span className="ndl-node">Boolean</span> node to a <span className="ndl-node">Component Inputs</span> node. This will make the input shows up as a <span className="ndl-data">boolean</span> (checkbox) in the Property Panel for instances of this component.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
<##head##>
|
||||
|
||||
## Inputs
|
||||
|
||||
| Data | Description |
|
||||
| --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Value</span> | The value to store in the node. The output value will equal this value, unless _Set_ is connected, then it will be updated when **Set** receives a signal. |
|
||||
|
||||
| Signal | Description |
|
||||
| --------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Set</span> | This is used to only update the output when _Save Value_ is set to true. This will allow you to freeze the stored value and only allow it to update under certain conditions, e.g. on a Tap. |
|
||||
|
||||
## Outputs
|
||||
|
||||
| Data | Description |
|
||||
| --------------------------------------- | ------------------------------ |
|
||||
| <span className="ndl-data">Value</span> | The boolean stored in the node |
|
||||
|
||||
| Signal | Description |
|
||||
| ------------------------------------------ | ----------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Stored</span> | This port sends a signal when the value is stored via the _Set_ input signal. |
|
||||
26
nodes/data/cloud-data/_acl.md
Normal file
26
nodes/data/cloud-data/_acl.md
Normal file
@@ -0,0 +1,26 @@
|
||||
### Access Control Rules
|
||||
|
||||
When creating and updating records you can also specify access control rules. By default all records created can be read and written by everyone, they are completely public. This is convenient in the beginning when you are working on your applications but as you want to make it publicly available you need to think about access control. You do this by adding access control rules when creating or updating records.
|
||||
|
||||
<div className="ndl-image-with-background m">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
You can have as many rules as you want. Each rule has a **Target** which can be one of **User**, **Everyone** or **Role**:
|
||||
|
||||
- **User** implies that this rule will target a specific user, you can either specify the **User Id** (that is the record Id for the user record) for the user or if omitted the current logged in user will be used.
|
||||
- **Everyone** means, well, this rule applies to everyone. You can use to to create read only objects, that can be publicly read but not written.
|
||||
- **Role** means that this object can be accessed as you specify by anyone belonging to a certain role. Please look at the access control [guide](/docs/guides/cloud-data/access-control) for more information.
|
||||
|
||||
All rules have the inputs **Read** and **Write** when you specify if the users targeted by the role have read / write access.
|
||||
|
||||
Each rule can, depending on the selected **Target** type have the following inputs (it's a good idea to change the label of your rule as in the image above to easier find the inputs when connecting):
|
||||
|
||||
| Data | Description |
|
||||
| ----------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">User Id</span> | The **User Id** of the user that the rule should apply to. If none is provided via a connection the currently logged in user will be used. This input is only available if the **User** target type is selected. |
|
||||
| <span className="ndl-data">Role</span> | The **Role Name** of the role that the rule should apply to. This input is only available if the **Role** target type is selected. |
|
||||
| <span className="ndl-data">Write</span> | Set to **true** for this rule to have write access. |
|
||||
| <span className="ndl-data">Read</span> | Set to **true** for this rule to have read access. |
|
||||
52
nodes/data/cloud-data/add-record-relation.md
Normal file
52
nodes/data/cloud-data/add-record-relation.md
Normal file
@@ -0,0 +1,52 @@
|
||||
---
|
||||
hide_title: true
|
||||
hide_table_of_contents: true
|
||||
title: Add Record Relation
|
||||
---
|
||||
|
||||
<##head##>
|
||||
|
||||
# Add Record Relation
|
||||
|
||||
This action node is used to create a relation between two records, the owning record and the target record.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
One record is the owning record (in this case **Group** records that can have a relation to many **Post** records), it should have a **Relation** type property.
|
||||
|
||||
You need to provide the <span className="ndl-data">Id</span> of the owning record. You also need to provide the <span className="ndl-data">Id</span> of the record that you want to add a relation to, this is the Target Record Id input.
|
||||
|
||||
Finally, send a <span className="ndl-signal">signal</span> to <span className="ndl-signal">Do</span> to perform the action.
|
||||
|
||||
<##head##>
|
||||
|
||||
## Inputs
|
||||
|
||||
| Data | Description |
|
||||
| -------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Class</span> | The **Class** of the owning record where you want to add the related object to. |
|
||||
| <span className="ndl-data">Id</span> | <##input:id##>Specify the **Id** of the record that you want to use as the owning record to add a relation to.<##input##> This input is only valid if **Id Source** is set to **Specify explicitly**. |
|
||||
| <span className="ndl-data">Relation</span> | You need to choose the **Relation** property of the owning class to use when creating the relation. |
|
||||
| <span className="ndl-data">Target Record Id</span> | <##input:target record id##>This input should be connected to the **Id** of the target record of the new relation.<##input##> |
|
||||
|
||||
@include "./id-source.md"
|
||||
|
||||
| Signal | Description |
|
||||
| -------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Do</span> | <##input:do##>When a signal is received on this input the relation will be created in the backend.<##input##> |
|
||||
|
||||
## Outputs
|
||||
|
||||
| Data | Description |
|
||||
| --------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Id</span> | <##output:id##>This is the **Id** of the owning record that have / will receive the new relation. It is simply a mirror of the **Id** input.<##output##> |
|
||||
| <span className="ndl-data">Error</span> | <##output:error##>The error message in case something went wrong when attempting to add the relation in the backend.<##output##> |
|
||||
|
||||
| Signal | Description |
|
||||
| ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Success</span> | <##output:success##>A signal is sent on this output when the relation has been added successfully in the backend.<##output##> |
|
||||
| <span className="ndl-signal">Failure</span> | <##output:failure##>A signal is sent on this output if something went wrong when adding the relation in the backend. The error message will be outputed on the **Error** output.<##output##> |
|
||||
39
nodes/data/cloud-data/cloud-file.md
Normal file
39
nodes/data/cloud-data/cloud-file.md
Normal file
@@ -0,0 +1,39 @@
|
||||
---
|
||||
hide_title: true
|
||||
hide_table_of_contents: true
|
||||
title: Cloud File
|
||||
---
|
||||
|
||||
<##head##>
|
||||
|
||||
# Cloud File
|
||||
|
||||
Represents a file that has been uploaded to the Noodl Cloud Services and stored as a file property in a **Record**.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
**Cloud File** is typically used in combination with the [Open File Picker](/nodes/utilities/open-file-picker) and the [Upload File](/nodes/data/cloud-data/upload-file) to upload a file and store a reference to it in the database. Then **Cloud File** is used to retrieve the reference and get the URL or Name of the file.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
<##head##>
|
||||
|
||||
## Inputs
|
||||
|
||||
| Data | Description |
|
||||
| -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Cloud File</span> | <##input:cloud file##>A file that has been stored in the Noodl Cloud Services. Often used in combination with a **Record** to retrieve the **Name** and **URL** of a file.<##input##> |
|
||||
|
||||
## Outputs
|
||||
|
||||
| Data | Description |
|
||||
| -------------------------------------- | -------------------------------------------------- |
|
||||
| <span className="ndl-data">URL</span> | <##output:url##>The URL of the file.<##output##> |
|
||||
| <span className="ndl-data">Name</span> | <##output:name##>The Name of the file.<##output##> |
|
||||
68
nodes/data/cloud-data/cloud-function.md
Normal file
68
nodes/data/cloud-data/cloud-function.md
Normal file
@@ -0,0 +1,68 @@
|
||||
---
|
||||
hide_title: true
|
||||
hide_table_of_contents: true
|
||||
title: Cloud Function
|
||||
---
|
||||
|
||||
<##head##>
|
||||
|
||||
# Cloud Function
|
||||
|
||||
Cloud functions are logic components that run in the cloud and not on the client like other logic components. The **Cloud Function** node is how you initiate a call to a cloud function component. Learn more about how to use cloud functions in this [guide](/docs/guides/cloud-logic/introduction).
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
You will first need to pick the cloud function that you want to call with this node.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
After you have picked the cloud function, the **Cloud Function** node will receive the input parameters and output result parameters defined in the cloud function so you can hook them up to the logic of your application.
|
||||
|
||||
A cloud function can either return a **Success** or **Failure** response, this will result in the corresponding output signal on the **Cloud Function** node. You can use this to trigger different flows in your logic.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
If a **Failure** signal is emitted you can also use the **Error** output that will contain the error message sent from the cloud function.
|
||||
|
||||
If a **Success** signal is sent the result parameters will be available as outputs on the **Cloud Function** node.
|
||||
|
||||
<##head##>
|
||||
|
||||
## Inputs
|
||||
|
||||
| Data | Description |
|
||||
| --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| <span className="ndl-data">Function</span> | <##input:functionName##>The cloud function component that this node will call.<##input##> |
|
||||
|
||||
### Parameters
|
||||
The **Cloud Function** node will receive all parameters specified in the [Request](/nodes/cloud-functions/request) node in the cloud function component as inputs. When the <span className="ndl-signal">Call</span> signal is received the values on the inputs will be sent to the cloud funciton.
|
||||
|
||||
| Signal | Description |
|
||||
| ---------------------------------------- | ------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Call</span> | <##input:call##>Send a signal on this input to issue the request to the cloud function.<##input##> |
|
||||
|
||||
## Outputs
|
||||
|
||||
| Data | Description |
|
||||
| ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
|
||||
| <span className="ndl-data">Error</span> | <##output:error##>If the cloud function results in an error status, this output will contain the error message. <##output##> |
|
||||
|
||||
### Result
|
||||
The **Cloud Function** node will receive all result parameters specified in any [Response](/nodes/cloud-functions/response) node in the cloud function component that is called. When the cloud function completes and retuns a **Sucess** status, any result parameters sent back will be available on these outputs.
|
||||
|
||||
| Signal | Description |
|
||||
| ------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Success</span> | <##output:success##>This is sent if the cloud function returns a **Success** status.<##output##> |
|
||||
| <span className="ndl-signal">Failure</span> | <##output:failure##>This is sent if the cloud function returns a **Failure** status.<##output##> |
|
||||
77
nodes/data/cloud-data/config.md
Normal file
77
nodes/data/cloud-data/config.md
Normal file
@@ -0,0 +1,77 @@
|
||||
---
|
||||
hide_title: true
|
||||
hide_table_of_contents: true
|
||||
title: Config
|
||||
---
|
||||
|
||||
<##head##>
|
||||
|
||||
# Config
|
||||
|
||||
This node is used to fetch a configuration parameter from the cloud services. Can be used to store any sort of parameters like API Keys, email templates etc. The node works much like the [Variable](/nodes/data/variable/variable-node) node.
|
||||
|
||||
<div className="ndl-image-with-background xl">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
You pick a **Parameter** in the properties of the node. First you must specify the **Parameter** in the **Config** section of the cloud services dashboard. Check out [this guide](/docs/guides/cloud-data/creating-a-backend) for more details on the dashboard.
|
||||
|
||||
<div className="ndl-image-with-background xl">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
<##head##>
|
||||
|
||||
When creating a parameter you can specify if it requires the **Master Key** or not. Requiring the master key means that you can only access these parameters in cloud functions, which is important for config parameters that needs to be kept secure.
|
||||
|
||||
Once you have create your parameters in the cloud services dashboard you can pick which parameter this node should read with the drop down.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
## Local Override
|
||||
|
||||
Config parameters are especially useful when you need to have values that vary depending if you are working in your **testing** or **production** environment (which cloud service you are currently using). You can also specify a local override for a config parameter so that **this particular node** will return that value when your are working locally with the project. That is, when the working in the editor or when viewing the project in an external browser using the ```localhost``` domain.
|
||||
|
||||
<div className="ndl-image-with-background xl">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
For the node above we want a special config parameter for when running locally so we can test without having to deploy every time, so we add a **Local Override** in the parameters of the config node.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
## Inputs
|
||||
|
||||
| Data | Description |
|
||||
| --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| <span className="ndl-data">Parameter</span> | <##input:configKey##>The config parameter to use for this node.<##input##> |
|
||||
|
||||
## Local Override
|
||||
|
||||
| Data | Description |
|
||||
| --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| <span className="ndl-data">Enable</span> | <##input:useDevValue##>Checking this will provide a special value for this node when running in the editor or from ```localhost```<##input##> |
|
||||
| <span className="ndl-data">Value</span> | <##input:devValue##>The value to return from this node when running in the editor or on ```localhost```<##input##> |
|
||||
|
||||
|
||||
## Outputs
|
||||
|
||||
| Data | Description |
|
||||
| ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
|
||||
| <span className="ndl-data">Value</span> | <##output:value##>The value for this config parameter for the current active cloud service, or the local override. <##output##> |
|
||||
|
||||
|
||||
47
nodes/data/cloud-data/create-new-record.md
Normal file
47
nodes/data/cloud-data/create-new-record.md
Normal file
@@ -0,0 +1,47 @@
|
||||
---
|
||||
hide_title: true
|
||||
hide_table_of_contents: true
|
||||
title: Create New Record
|
||||
---
|
||||
|
||||
<##head##>
|
||||
|
||||
# Create New Record
|
||||
|
||||
This node is used to create a new record of a given class. You specify the class of record to be created in the Property Panel. Sending a <span className="ndl-signal">signal</span> to <span className="ndl-signal">Do</span> will perform the action.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
You can also provide values for the properties of the record either via connections or by typing the values in the property panel.
|
||||
|
||||
<##head##>
|
||||
|
||||
## Inputs
|
||||
|
||||
| Data | Description |
|
||||
| ------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Class</span> | Choose a class for the record that you want to create. |
|
||||
| <span className="ndl-data">Source Object Id</span> | <##input:source object id##>This input can be used to provide an object whose properties will be used as the initial values of the newly created record. <##input##> |
|
||||
| <span className="ndl-data">Property Inputs</span> | When the class of the record to be created is choosen, all properties of that class will be available as inputs. When the **Do** signal is received a new record will be created with the values of the properties either specified in the property panel or via connections. <##input:prop-\*##>The value of these inputs will become the properties of the newly created record.<##input##> |
|
||||
|
||||
| Signal | Description |
|
||||
| -------------------------------------- | ---------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Do</span> | <##input:do##>Send a signal on this input to create a new record.<##input##> |
|
||||
|
||||
@include "./_acl.md"
|
||||
|
||||
## Outputs
|
||||
|
||||
| Data | Description |
|
||||
| --------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Id</span> | <##output:id##>The **Id** of the new record that was created if the action was successful.<##output##> |
|
||||
| <span className="ndl-data">Error</span> | <##output:error##>The specific error message in case something went wrong when creating the record.<##output##> |
|
||||
|
||||
| Signal | Description |
|
||||
| ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Success</span> | <##output:success##>A signal is sent here when the new record have been created successfully.<##output##> |
|
||||
| <span className="ndl-signal">Failure</span> | <##output:failure##>A signal is sent on this output if something went wrong when creating the record.<##output##> You can find the specific error in the **Error** output. |
|
||||
48
nodes/data/cloud-data/delete-record.md
Normal file
48
nodes/data/cloud-data/delete-record.md
Normal file
@@ -0,0 +1,48 @@
|
||||
---
|
||||
hide_title: true
|
||||
hide_table_of_contents: true
|
||||
title: Delete Record
|
||||
---
|
||||
|
||||
<##head##>
|
||||
|
||||
# Delete Record
|
||||
|
||||
This node will delete a **Record** of a given **Class** from the Noodl Cloud Services backend.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
You will need to provide the **Id** of the record to be deleted, there are multiple ways to do this, see the **Id Source** property for details.
|
||||
|
||||
Then send a signal on the **Do** input to perform the action.
|
||||
|
||||
<##head##>
|
||||
|
||||
## Inputs
|
||||
|
||||
| Data | Description |
|
||||
| --------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Class</span> | You need to select the **Class** of records that this node will act on. |
|
||||
| <span className="ndl-data">Id</span> | <##input:id##>Specify the **Id** of the record that you want to delete.<##input##> This input is only valid if **Id Source** is set to **Specify explicitly**. |
|
||||
|
||||
@include "./id-source.md"
|
||||
|
||||
| Signal | Description |
|
||||
| -------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Do</span> | <##input:do##>When a signal is received on this input the record will be deleted on the backend.<##input##> |
|
||||
|
||||
## Outputs
|
||||
|
||||
| Data | Description |
|
||||
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| <span className="ndl-data">Id</span> | <##output:id##>The **Id** of the record that will be / was deleted by this node. Simply reflecting the **Id** input.<##output##> |
|
||||
| <span className="ndl-data">Error</span> | <##output:error##>If something went wrong when deleting the record in the backend, this output will contain the error message.<##output##> |
|
||||
|
||||
| Signal | Description |
|
||||
| ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Success</span> | <##output:success##>A signal is sent on this output when the record have been successfully deleted in the backend.<##output##> |
|
||||
| <span className="ndl-signal">Failure</span> | <##output:failure##>A signal is sent on this output if something went wrong when attempting to delete the record in the backend.<##output##> |
|
||||
54
nodes/data/cloud-data/filter-records.md
Normal file
54
nodes/data/cloud-data/filter-records.md
Normal file
@@ -0,0 +1,54 @@
|
||||
---
|
||||
hide_title: true
|
||||
hide_table_of_contents: true
|
||||
title: Filter Record
|
||||
---
|
||||
|
||||
<##head##>
|
||||
|
||||
# Filter Record
|
||||
|
||||
This node is used to filter an <span className="ndl-data">array</span> that is assumed to contain Records of a given class based on custom filter conditions.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
You can specify both filter and sorting visually.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
<##head##>
|
||||
|
||||
## Inputs
|
||||
|
||||
| Data | Description |
|
||||
| --------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Enabled</span> | <##input:enabled##>If disabled the node will simply pass the input array through without change, if enabled the input array will be filtered and sorted.<##input##> |
|
||||
| <span className="ndl-data">Class</span> | The **Class** of records that the input array is assumed to contain. |
|
||||
| <span className="ndl-data">Use Limit</span> | <##input:use limit##>Enabled or disable limiting of the input array to a specific number of maximum records.<##input##> |
|
||||
| <span className="ndl-data">Limit</span> | <##input:limit##>The number of maximum records to limit the output filtered array to contain.<##input##> |
|
||||
| <span className="ndl-data">Skip</span> | <##input:skip##>The number of records in the beginning of the output filtered array to skip.<##input##> |
|
||||
| <span className="ndl-data">Items</span> | <##input:items##>The input array of records that should be filtered by this node.<##input##> |
|
||||
| <span className="ndl-data">Filter Parameter Inputs</span> | <##input:fp-\*##>Each filter parameter get an input where a connection can be made to provide the value for the paramter.<##input##> |
|
||||
|
||||
| Signal | Description |
|
||||
| ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Filter</span> | <##input:filter##>Send a signal on this input to perform the filtering, this will produce a new filtered array on the **Items** output. If this input does not have a connection, the input array will be filtered every time it is updated.<##input##> |
|
||||
|
||||
## Outputs
|
||||
|
||||
| Data | Description |
|
||||
| ------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Items</span> | <##output:items##>This output will contain the filtered array of records.<##output##> |
|
||||
| <span className="ndl-data">Count</span> | <##output:count##>The number of records in the filtered output array.<##output##> |
|
||||
| <span className="ndl-data">First Record Id</span> | <##output:first record id##>The **Id** of the first record in the filtered output array.<##output##> |
|
||||
|
||||
| Signal | Description |
|
||||
| -------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Filtered</span> | <##output:filtered##>A signal will be sent on this output when the input array have been successfully filtered.<##output##> |
|
||||
5
nodes/data/cloud-data/id-source.md
Normal file
5
nodes/data/cloud-data/id-source.md
Normal file
@@ -0,0 +1,5 @@
|
||||
An Id of a record is needed to perform the action of this node:
|
||||
|
||||
| Data | Description |
|
||||
| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Id Source</span> | The **Id Soure** 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. |
|
||||
346
nodes/data/cloud-data/query-records.md
Normal file
346
nodes/data/cloud-data/query-records.md
Normal file
@@ -0,0 +1,346 @@
|
||||
---
|
||||
hide_title: true
|
||||
hide_table_of_contents: true
|
||||
title: Query Records
|
||||
---
|
||||
|
||||
<##head##>
|
||||
|
||||
# Query Records
|
||||
|
||||
This node is used to fetch a selection of records from the Noodl Cloud Services backend. You can provide a query to define the selection of records you want to retrieve.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
You can specify the query using filter, sorting and limit in the Property Panel.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
<##head##>
|
||||
|
||||
## Filters
|
||||
|
||||
By default the **Query Records** will fetch all **Records**, you can however add a filter. You can choose from a simple filter where you can filter on one or more **Record** properties, or a more advanced JSON based filter syntax, that also can include Javascript logic.
|
||||
|
||||
### Simple Filters
|
||||
|
||||
The **Simple** filters are created through a UI where you select properties and how to filter them in the filter panel.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
Note that you can select if you want the filter to use a static value or a value that comes from an input.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
### Sorting with Simple Filters
|
||||
|
||||
By default the **Query Records** does not return the result of a fetch sorted. You can specify sorting. Like filters you add which properties you want to sort on.
|
||||
|
||||
For each property you can choose the sorting order.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
## Limit
|
||||
|
||||
Be default up to a 1000 records are returned. But you can specify a **Limit**, the number of records to return, and **Skip**, at what index to start returning records. This is very useful for pagination when listing records.
|
||||
|
||||
<div className="ndl-image-with-background m">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
## Total Count
|
||||
|
||||
If you choose to limit the returned records or if you have more than the maximum allowed return records you can request the total count to be returned with your query.
|
||||
|
||||
<div className="ndl-image-with-background m">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
By enabling this you will provide the total count on the <span class="ndl-data">Total Count</span> output.
|
||||
|
||||
## Advanced filters
|
||||
|
||||
If you choose _Advanced_ as filter type you will get the option to specify a filter script. This is regular javascript code but you need to end the script by calling the _where_ function with the filter definition provided. This is done using the following syntax:
|
||||
|
||||
```javascript
|
||||
where({
|
||||
Completed: { equalTo: true },
|
||||
});
|
||||
```
|
||||
|
||||
The above filter will return all **Records** in the collection that has the _Completed_ property _true_. You can select from a number of operators:
|
||||
|
||||
- **lessThan** Less Than
|
||||
- **lessThanOrEqualTo** Less Than Or Equal To
|
||||
- **greaterThan** Greater Than
|
||||
- **greaterThanOrEqualTo** Greater Than Or Equal To
|
||||
- **equalTo** Not Equal To
|
||||
- **notEqualTo** Not Equal To
|
||||
- **containedIn** Contained In
|
||||
- **notContainedIn** Not Contained in
|
||||
- **exists** A value is set for the key
|
||||
- **matchesRegex** Check if a value matches a regex pattern
|
||||
- **text** Text search in one or several columns using a text index
|
||||
- **idEqualTo** Match the id of the item to a specific id
|
||||
- **idContainedIn** Check if the id of the item matches an id in an array of ids
|
||||
- **pointsTo** Check if the id of the item matches an id in an array of ids
|
||||
- **relatedTo** Checks if the item is related to another item, through a _relation_
|
||||
|
||||
For instance, to filter on if a certain property (in this example Letter) is one of many possible values:
|
||||
|
||||
```javascript
|
||||
where({
|
||||
Letter: { containedIn: ["A", "B", "C"] },
|
||||
});
|
||||
```
|
||||
|
||||
Or to filter all **Records** that have a value set for a specific property:
|
||||
|
||||
```javascript
|
||||
where({
|
||||
Letter: { exists: true },
|
||||
});
|
||||
```
|
||||
|
||||
You can also combine these filters into expressions using **and** and **or**, for instance:
|
||||
|
||||
```javascript
|
||||
where({
|
||||
and: [{ ZipCode: { exists: true } }, { Score: { greaterThan: 10 } }],
|
||||
});
|
||||
```
|
||||
|
||||
You can also use the **matchesRegex** operator to filter by regular expression, this is generally slow and not recommended for large sets. Learn more [here](https://docs.mongodb.com/manual/reference/operator/query/regex/)
|
||||
|
||||
```javascript
|
||||
where({
|
||||
SomeString: { matchesRegex: "pattern", options: "i" },
|
||||
});
|
||||
```
|
||||
|
||||
As mentioned above the filter script is a javascript function so you can provide javascript code if you like:
|
||||
|
||||
```javascript
|
||||
where({
|
||||
SomeDate: { equalTo: new Date() },
|
||||
});
|
||||
```
|
||||
|
||||
You can also specify variables instead of explicitly specifying the filter values, this will create an input port on the _Query Collection_ node that can then be connected to. You specify variables simply by using the **Inputs** object. The filter below will create an input called MyStringInput.
|
||||
|
||||
```javascript
|
||||
where({
|
||||
SomeString: { equalTo: Inputs.MyStringInput },
|
||||
});
|
||||
```
|
||||
|
||||
You can also do text search in strings. This will create an index in the database and text search only works on one property so you have to choose wisely. Also text search matches whole words and must be the first filter in an _and_ or _or_ sequence.
|
||||
|
||||
```javascript
|
||||
where({
|
||||
SomeString: { text: { search: Inputs.MyStringInput } },
|
||||
});
|
||||
```
|
||||
|
||||
You can also toggle case sensitivity for text searches.
|
||||
|
||||
```javascript
|
||||
where({
|
||||
SomeString: {
|
||||
text: {
|
||||
search: {
|
||||
term: Inputs.MyStringInput,
|
||||
caseSensitive: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
If you need to match the _Id_ of **Records** in the collection you need to use the special operation:
|
||||
|
||||
```javascript
|
||||
where({
|
||||
idEqualTo: Inputs.TheRecordId,
|
||||
});
|
||||
```
|
||||
|
||||
In the above filter you can connect a _Record Id_ output to the _TheRecordId_ parameter to fetch just one specific object. You can also request a set of object based on their Id.
|
||||
|
||||
```javascript
|
||||
where({
|
||||
idContainedIn: [Inputs.FirstObjectId, Inputs.SecondObjectId],
|
||||
});
|
||||
```
|
||||
|
||||
Some properties in your _Records_ can be of _Pointer_ type, that means that they reference another **Records** with a specific _Id_. If you want to filter out **Records** that point to a specific **Records**, use this syntax. Let's say you have a collection of _Post_ **Records**, each have a set of _Comment_ **Records** where each _Comment_ points back to it's owning _Post_ via the _Owner_ property. The filter below will find all _Comments_ for a _Post_ given that you provide the post id.
|
||||
|
||||
```javascript
|
||||
where({
|
||||
Owner: { pointsTo: Inputs.MyPostId },
|
||||
});
|
||||
```
|
||||
|
||||
You can also provide an array if you want to find _Comments_ that are related to a set of _Post_ **Records**.
|
||||
|
||||
```javascript
|
||||
where({
|
||||
Owner: { pointsTo: [Inputs.MyFirstPostId, Inputs.MySecondPost] },
|
||||
});
|
||||
```
|
||||
|
||||
Don't forget that you need to send a signal to _Fetch_ to perform a new fetch with a new filter if any of the filter inputs have changed.
|
||||
|
||||
**Records** also support many-to-many relationships via _Relations_. <!-- , check out the guide [here](/guides/relations) for more information. --> You can filter our all **Records** in the collection you are querying that are related to a specific **Record** via a _Relation_ with a given key using:
|
||||
|
||||
```javascript
|
||||
where({
|
||||
relatedTo: { id: Inputs.MyRecordWithARelation, key: "the-relation-key" },
|
||||
});
|
||||
```
|
||||
|
||||
### Geo queries
|
||||
|
||||
Noodl allows you to associate real-world latitude and longitude coordinates with an object. Using a **GeoPoint** property type in a class allows queries to take into account the proximity of an object to a reference point. This allows you to easily do things like find out what user is closest to another user or which places are closest to a user.
|
||||
|
||||
If you have a **Record** with a **GeoPoint** type property called **Location** you can use these queries, first `nearSphere`, it will return results ordered by the distance from the specified `latitude` and `longitude` point.
|
||||
|
||||
```javascript
|
||||
where({
|
||||
Location: {
|
||||
nearSphere: {
|
||||
latitude: 48.0,
|
||||
longitude: -110.1,
|
||||
},
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
You can also specify a maximum distance from the center point by using either `maxDistanceInMiles` or `maxDistanceInKilometers`, e.g.
|
||||
|
||||
```javascript
|
||||
where({
|
||||
Location: {
|
||||
nearSphere: {
|
||||
latitude: 48.0,
|
||||
longitude: -110.1,
|
||||
maxDistanceInKilometers: 100,
|
||||
},
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
Another option is to query only records with **Location** that are within a certain rectangular bounding box. This makes it possible to query for the set of records that are contained within a particular area. It's done using the `withinBox` query.
|
||||
|
||||
```javascript
|
||||
where({
|
||||
Location: {
|
||||
withinBox: [
|
||||
{
|
||||
latitude: 37.71,
|
||||
longitude: -122.53,
|
||||
},
|
||||
{
|
||||
latitude: 30.82,
|
||||
longitude: -122.37,
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
It’s also possible to query for the set of records that are contained within or on the bounds of a polygon. Opened or closed paths are allowed, minimum of 3 points. It's done using the `withinPolygon` query.
|
||||
|
||||
```javascript
|
||||
where({
|
||||
Location: {
|
||||
withinPolygon: [
|
||||
{
|
||||
latitude: 25.774,
|
||||
longitude: -80.19,
|
||||
},
|
||||
{
|
||||
latitude: 18.466,
|
||||
longitude: -66.118,
|
||||
},
|
||||
{
|
||||
latitude: 32.321,
|
||||
longitude: -64.757,
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
### Sorting in advanced filters
|
||||
|
||||
To specify the sort order when using advanced filter you run a function called _sort_ in the filter script.
|
||||
|
||||
```javascript
|
||||
where({
|
||||
// You where filter here
|
||||
});
|
||||
|
||||
sort(["createdAt"]);
|
||||
```
|
||||
|
||||
The sort function takes an array with strings specifying the names of the properties you want to sort by. You can prefix the property name with "-" to specify that you want to sort in descending order instead of the default ascending order.
|
||||
|
||||
```javascript
|
||||
sort(["-Age", "createdAt"]);
|
||||
```
|
||||
|
||||
## Inputs
|
||||
|
||||
| Data | Description |
|
||||
| --------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Class</span> | Select the **Class** for the types of records this node should query. When the **Class** is selected you can create filters and sorting based on the properties of the **Class**. |
|
||||
| <span className="ndl-data">Filter</span> | This specifies the type of filter, you can choose from:<br/><br/>`Visual`: Specify your filter using the visual filter editor.<br/>`JavaScript`: Specify your filter using JavaScript (this is more flexible and you can create more dynamic queyries but it's also more complex) |
|
||||
| <span className="ndl-data">Use Limit</span> | <##input:use limit##>Enable or disable the use of limit, i.e. that you can specify how many records are returned as a maximum and if a number of record should be skipped.<##input##> |
|
||||
| <span className="ndl-data">Limit</span> | <##input:limit##>The maximum number of records to be returned by the backend.<##input##> |
|
||||
| <span className="ndl-data">Skip</span> | <##input:skip##>This property allows you to skip a number of records from being returned by the backend. Using **Skip** and **Limit** allows you to do paging, e.g. return records from 10-20.<##input##> |
|
||||
| <span className="ndl-data">Fetch Total Count</span> | <##input:storageEnableCount##>Enable this to also query for the total count of records matching the filters. Even if you limit the returned result. <##input##> |
|
||||
| <span className="ndl-data">Query Parameters</span> | <##input:qp-\*##>The input for specifying the value of a query parameter.<##input##> Each paramteter used in your query will get an input where you can provide a value through a connection.<##input##> |
|
||||
|
||||
| Signal | Description |
|
||||
| -------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Do</span> | <##input:do##>Send a signal here to perform the query and fetch matching records from the backend.<##input##> |
|
||||
|
||||
## Outputs
|
||||
|
||||
| Data | Description |
|
||||
| ------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Items</span> | <##output:items##>The result of the query as an array of **Records**.<##output##> |
|
||||
| <span className="ndl-data">Count</span> | <##output:count##>The number of records in the result.<##output##> |
|
||||
| <span className="ndl-data">First Record Id</span> | <##output:first record id##>The Id of the first Record in the result array.<##output##> |
|
||||
| <span className="ndl-data">Error</span> | <##output:error##>This output contains the error message incase something when wrong when executing the query.<##output##> |
|
||||
| <span className="ndl-data">Total Count</span> | <##output:storageTotalCount##>If **Fetch Total Count** is enabled then this output will contain the total number of records that match the query. Even if you limit the returned result.<##output##> |
|
||||
|
||||
| Signal | Description |
|
||||
| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| <span className="ndl-signal">Success</span> | <##output:success##>A signal is sent here if the query was successful and the result is ready.<##output##> |
|
||||
| <span className="ndl-signal">Failure</span> | <##output:failure##>A signal is sent here if something went wrong with the query. You can find the error message via the **Error** output.<##output##> |
|
||||
50
nodes/data/cloud-data/record.md
Normal file
50
nodes/data/cloud-data/record.md
Normal file
@@ -0,0 +1,50 @@
|
||||
---
|
||||
hide_title: true
|
||||
hide_table_of_contents: true
|
||||
title: Record
|
||||
---
|
||||
|
||||
<##head##>
|
||||
|
||||
# Record
|
||||
|
||||
This node is used to read data from a **Record**. A **Record** is an **Object** with a **Class**, with predefined properties of specific types and that can be stored in the Noodl backend.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
You have to choose the class for the **Record** node in the property panel and you must make sure that the node has the Id of the record it should access (there are multiple ways to do this, see full docs for details).
|
||||
|
||||
Then you can access the properties of the specific **Record** through the property outputs.
|
||||
<##head##>
|
||||
|
||||
## Inputs
|
||||
|
||||
| Data | Description |
|
||||
| --------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Class</span> | Select the **Class** for this Records that this node will get data from. Choosing the **Class** will make the node get all properties of the class as outputs. |
|
||||
| <span className="ndl-data">Id</span> | <##input:id##>The Id of the **Record** that this node should read data from.<##input##> |
|
||||
|
||||
@include "./id-source.md"
|
||||
|
||||
| Signal | Description |
|
||||
| ----------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Fetch</span> | <##input:fetch##>Send a signal on this input to fetch the data for this **Record** from the backend. All **Record** nodes that share the **Id** with this node (i.e. are reading data from the same record) will be updated.<##input##> |
|
||||
|
||||
## Outputs
|
||||
|
||||
| Data | Description |
|
||||
| -------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Id</span> | <##output:id##>The Id of the **Record** this node is accessing the properties for.<##output##> |
|
||||
| <span className="ndl-data">Error</span> | <##output:error##>This will contain the error message if a fetch action failed and the **Failure** signal was emitted.<##output##> |
|
||||
| <span className="ndl-data">Class Properties</span> | <##output:prop-\*##>The value of this property in the record that the node reads from.<##output##> This node will have an output for each property in the **Class** that have been selected on the node. |
|
||||
|
||||
| Signal | Description |
|
||||
| ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Fetched</span> | <##output:fetched##>A signal is sent on this output when a **Fetch** has been completed successfully. This is as a result of triggering a fetch by sending a signal to the **Fetch** input.<##output##> |
|
||||
| <span className="ndl-signal">Failure</span> | <##output:failure##>A signal is sent on this output if a fetch action has failed. This is a potential result of triggering a fetch by sending a signal to the **Fetch** input.<##output##> |
|
||||
| <span className="ndl-signal">Changed</span> | <##output:changed##>A signal is sent on this output if the record that this node is reading data from has changed locally.<##output##> |
|
||||
| <span className="ndl-signal">Property Changed Signal</span> | <##output:changed-\*##>A signal is sent here if the value of the property on the record this node is reading data from has changed locally.<##output##> |
|
||||
52
nodes/data/cloud-data/remove-record-relation.md
Normal file
52
nodes/data/cloud-data/remove-record-relation.md
Normal file
@@ -0,0 +1,52 @@
|
||||
---
|
||||
hide_title: true
|
||||
hide_table_of_contents: true
|
||||
title: Remove Record Relation
|
||||
---
|
||||
|
||||
<##head##>
|
||||
|
||||
# Remove Record Relation
|
||||
|
||||
This node is used to remove a relation between two records, the owning record and the target record.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
One record is the owning record (in this case **Group** records that can have a relation to many **Post** records), it should have a **Relation** type property.
|
||||
|
||||
You need to provide the <span className="ndl-data">Id</span> of the owning record. You also need to provide the <span className="ndl-data">Id</span> of the record that you want to add a relation to, this is the <span className="ndl-data">Target Record Id</span> input.
|
||||
|
||||
Finally, send a <span className="ndl-signal">signal</span> to <span className="ndl-signal">Do</span> to perform the action.
|
||||
|
||||
<##head##>
|
||||
|
||||
## Inputs
|
||||
|
||||
| Data | Description |
|
||||
| -------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Class</span> | The **Class** of the owning record where you want to remove the relation from. |
|
||||
| <span className="ndl-data">Id</span> | <##input:id##>Specify the **Id** of the record that you want to use as the owning record to remove an existing relation from.<##input##> This input is only valid if **Id Source** is set to **Specify explicitly**. |
|
||||
| <span className="ndl-data">Relation</span> | You need to choose the **Relation** property of the owning class to use when removing the relation. |
|
||||
| <span className="ndl-data">Target Record Id</span> | <##input:target record id##>This input should be connected to the **Id** of the target record that have an existing relation to the owning record via the **Relation** property that should be removed.<##input##> |
|
||||
|
||||
@include "./id-source.md"
|
||||
|
||||
| Signal | Description |
|
||||
| -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Do</span> | <##input:do##>When a signal is received on this input the relation will be removed in the backend, if it exists.<##input##> |
|
||||
|
||||
## Outputs
|
||||
|
||||
| Data | Description |
|
||||
| --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Id</span> | <##output:id##>This is the **Id** of the owning record. It is simply a mirror of the **Id** input.<##output##> |
|
||||
| <span className="ndl-data">Error</span> | <##output:error##>The error message in case something went wrong when attempting to remove the relation in the backend.<##output##> |
|
||||
|
||||
| Signal | Description |
|
||||
| ------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Success</span> | <##output:success##>A signal is sent on this output when the relation has been removed successfully in the backend.<##output##> |
|
||||
| <span className="ndl-signal">Failure</span> | <##output:failure##>A signal is sent on this output if something went wrong when removing the relation in the backend. The error message will be outputed on the **Error** output.<##output##> |
|
||||
52
nodes/data/cloud-data/set-record-properties.md
Normal file
52
nodes/data/cloud-data/set-record-properties.md
Normal file
@@ -0,0 +1,52 @@
|
||||
---
|
||||
hide_title: true
|
||||
hide_table_of_contents: true
|
||||
title: Set Record Properties
|
||||
---
|
||||
|
||||
<##head##>
|
||||
|
||||
# Set Record Properties
|
||||
|
||||
This action node will set property values of a record.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
You need specify the class of the record in the property panel. Then you can either specify the values of the properties to set in the property panel or by providing them as an input connection.
|
||||
|
||||
Send a <span className="ndl-signal">signal</span> to <span className="ndl-signal">Do</span> to perform the action.
|
||||
<##head##>
|
||||
|
||||
## Inputs
|
||||
|
||||
| Data | Description |
|
||||
| ------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Class</span> | The class of record for this node. Choosing the class will determine which property inputs that become available on the node. |
|
||||
| <span className="ndl-data">Store to</span> | <##input:store to##>Specifies if this node should store both to the cloud and locally, or only locally.<##input##> |
|
||||
| <span className="ndl-data">Properties to store</span> | <##input:properties to store##>Specifies if only the explicitly specified properties should be save, **only specified**, this means that only the properties that have a value either in the property panel or via an input connection will be written to the cloud record. If **All** is selected that means that all properties will always be written, if there is no explicit value provided on this node the value of the object with the corresponding **Id** will be used.<##input##> |
|
||||
| <span className="ndl-data">Id</span> | <##input:id##>Specify the **Id** of the record that you want to set the properties on.<##input##> This input is only valid if **Id Source** is set to **Specify explicitly**. |
|
||||
| <span className="ndl-data">Property Inputs</span> | <##input:prop-\*##>The value to set this property to when the action is triggered.<##input##> For each property in the specified class there will be an input of the correct type. You can provide the values for the inputs either through connections or by specifying them in the property panel. |
|
||||
|
||||
@include "./id-source.md"
|
||||
|
||||
| Signal | Description |
|
||||
| -------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Do</span> | <##input:do##>When a signal is received on this input the properties will be set on the record.<##input##> |
|
||||
|
||||
@include "./_acl.md"
|
||||
|
||||
## Outputs
|
||||
|
||||
| Data | Description |
|
||||
| --------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Id</span> | <##output:id##>The **Id** of the record where the properties will be updated by this node.<##output##> |
|
||||
| <span className="ndl-data">Error</span> | <##output:error##>The specific error message in case something went wrong when updating the record.<##output##> |
|
||||
|
||||
| Signal | Description |
|
||||
| ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Success</span> | <##output:success##>A signal is sent here when the record have been updated successfully.<##output##> |
|
||||
| <span className="ndl-signal">Failure</span> | <##output:failure##>A signal is sent on this output if something went wrong when updating the record.<##output##> You can find the specific error in the **Error** output. |
|
||||
45
nodes/data/cloud-data/upload-file.md
Normal file
45
nodes/data/cloud-data/upload-file.md
Normal file
@@ -0,0 +1,45 @@
|
||||
---
|
||||
hide_title: true
|
||||
hide_table_of_contents: true
|
||||
title: Upload File
|
||||
---
|
||||
|
||||
<##head##>
|
||||
|
||||
# Upload File
|
||||
|
||||
This node uploads a file to the Noodl Cloud Services. Can be used in combination with a **Record** to link the file to a property. When retrieving the file reference you can get the **URL** to the file and **Name** of file using a [Cloud File](/nodes/data/cloud-data/cloud-file) node.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
<##head##>
|
||||
|
||||
## Inputs
|
||||
|
||||
| Data | Description |
|
||||
| -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">File</span> | <##input:file##>An HTML5 [File](https://developer.mozilla.org/en-US/docs/Web/API/File). The [File Picker](/nodes/utilities/open-file-picker) can be used to open a file dialog picker and generate the **File** from a local file. It's also possible to retrieve the File from external sources, or generate it by code. <##input##> |
|
||||
|
||||
| Signal | Description |
|
||||
| ------------------------------------------ | ---------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Upload</span> | <##input:upload##>Triggers the upload to start.<##input##> |
|
||||
|
||||
## Outputs
|
||||
|
||||
| Data | Description |
|
||||
| --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Cloud File</span> | <##output:cloudFile##>A [Cloud File](/nodes/data/cloud-data/cloud-file), which consists of an URL and a file name. Can be connected to a property of a [Record](/nodes/data/cloud-data/record) if the property type is specified as 'File'.<##output##> |
|
||||
| <span className="ndl-data">Total Bytes</span> | <##output:progressTotalBytes##>The total size of the file in bytes that is being uploaded.<##output##> |
|
||||
| <span className="ndl-data">Uploaded Bytes</span> | <##output:progressLoadedBytes##>Contains the number of bytes have been uploaded so far. Starts at 0, and moves towards **Total Bytes** after the **Upload** input signal has been triggered. The value is updated each time the **Progress Changed** event is sent.<##output##> |
|
||||
| <span className="ndl-data">Uploaded Percent</span> | <##output:progressLoadedPercent##>The current percentage of the file that have been uploaded. Starts at 0, and moves towards 100 after the **Upload** input signal has been triggered. The value is updated each time the **Progress Changed** event is sent.<##output##> |
|
||||
| <span className="ndl-data">Error</span> | <##output:error##>The error message as a string, if the upload fails.<##output##> |
|
||||
| <span className="ndl-data">Error Status Code</span> | <##output:errorStatus##>An [HTTP error code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). For example, `413` if the file is too large.<##output##> |
|
||||
|
||||
| Signal | Description |
|
||||
| ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| <span className="ndl-signal">Progress Changed</span> | <##output:progressChanged##>This event is used to track the upload progress. It is triggered multiple times during an upload when **Uploaded Bytes** and **Uploaded Percent** are updated.<##output##> |
|
||||
| <span className="ndl-signal">Success</span> | <##output:success##>This event triggers when the file was uploaded successfully.<##output##> |
|
||||
| <span className="ndl-signal">Failure</span> | <##output:failure##>This event triggers if there was en error uploading the file.<##output##> |
|
||||
41
nodes/data/color.md
Normal file
41
nodes/data/color.md
Normal file
@@ -0,0 +1,41 @@
|
||||
---
|
||||
hide_title: true
|
||||
hide_table_of_contents: true
|
||||
title: Color
|
||||
---
|
||||
|
||||
<##head##>
|
||||
|
||||
# Color
|
||||
|
||||
This node holds a <span className="ndl-data">color</span> value.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
The <span className="ndl-data">color</span> value can either be static or dynamic using the <span className="ndl-data">Value</span> and <span className="ndl-signal">Set</span> inputs.
|
||||
|
||||
<##head##>
|
||||
|
||||
## Inputs
|
||||
|
||||
| Data | Description |
|
||||
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Value</span> | The value to store in the node. The output value will equal this value, unless _Set_ is connected, then the value will be updated when a signal is received at the _Set_ input. |
|
||||
|
||||
| Signal | Description |
|
||||
| --------------------------------------- | ---------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Set</span> | This is used to only update the output when a signal is sent to _Set_. |
|
||||
|
||||
## Outputs
|
||||
|
||||
| Data | Description |
|
||||
| --------------------------------------- | ---------------------------- |
|
||||
| <span className="ndl-data">Value</span> | The color stored in the node |
|
||||
|
||||
| Signal | Description |
|
||||
| ------------------------------------------ | -------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Stored</span> | This port sends a signal when the value is updated as a result of the _Set_ signal being received. |
|
||||
47
nodes/data/number.md
Normal file
47
nodes/data/number.md
Normal file
@@ -0,0 +1,47 @@
|
||||
---
|
||||
hide_title: true
|
||||
hide_table_of_contents: true
|
||||
title: Number
|
||||
---
|
||||
|
||||
<##head##>
|
||||
|
||||
# Number
|
||||
|
||||
This node holds a <span className="ndl-data">number</span> value. It is local to the component and cannot be accessed elsewhere in the app.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
You can also use the <span className="ndl-node">Number</span> node connected to a <span className="ndl-node">Component Inputs</span> node. This will make sure the input shows up as a <span className="ndl-data">number</span> input in the Property Panel for instances of this component.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
<##head##>
|
||||
|
||||
## Inputs
|
||||
|
||||
| Data | Description |
|
||||
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Value</span> | The value to store in the node. The output value will equal this value, unless _Set_ is connected, then the value will be updated when a signal is received at the _Set_ input. |
|
||||
|
||||
| Signal | Description |
|
||||
| --------------------------------------- | ---------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Set</span> | This is used to only update the output when a signal is sent to _Set_. |
|
||||
|
||||
## Outputs
|
||||
|
||||
| Data | Description |
|
||||
| --------------------------------------- | ----------------------------- |
|
||||
| <span className="ndl-data">Value</span> | The number stored in the node |
|
||||
|
||||
| Signal | Description |
|
||||
| ------------------------------------------ | ---------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Stored</span> | A signal is outputted here when the value is updated as a result of the _Set_ signal being received. |
|
||||
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##> |
|
||||
137
nodes/data/rest.md
Normal file
137
nodes/data/rest.md
Normal file
@@ -0,0 +1,137 @@
|
||||
---
|
||||
hide_title: true
|
||||
title: REST
|
||||
---
|
||||
|
||||
<##head##>
|
||||
|
||||
# REST
|
||||
|
||||
This node is used to connect to external [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) endpoints to make requests and expose data. It supports request content in **JSON** format.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
You initiate the request by sending a <span className="ndl-signal">signal</span> to the <span className="ndl-signal">Fetch</span> input. Any inputs and outputs to the node are specified in the `request` and `response` scripts.
|
||||
|
||||
<##head##>
|
||||
|
||||
## Request and response script
|
||||
|
||||
The REST node uses a script much like the [Script](/nodes/javascript/script) node to prepare the request and parse the response.
|
||||
Any variables with the prefix **Inputs.** and **Outputs.** will be exposed as inputs and outputs to the node. So you can use these inputs in the request script to prepare the REST call, and the outputs in the response script to parse the response into outputs.
|
||||
|
||||
### Request
|
||||
|
||||
The first script is used to prepare the request before it is sent to the REST endpoint.
|
||||
The _Inputs_ object contains the values of the inputs specified in the section above at the time the
|
||||
request was initiated. The _Request_ object contains details on the request that can be adjusted if necessary.
|
||||
|
||||
- _resource_ - Contains the resource for the request, i.e. the URL.
|
||||
- _method_ - Contains the method of the request.
|
||||
- _headers_ - This is a map containing all headers to the request, add or remove headers in the function.
|
||||
- _parameters_ - This is a map containing all parameters that will be appended to the URL of the request, add or remove in the function.
|
||||
- _content_ - Contains the content of the request, the content will be encoded as JSON when the request is made.
|
||||
|
||||
The example below will create two inputs that you can connect to this node from other data in your applications. It modifies the headers and content for the request.
|
||||
|
||||
```javascript
|
||||
Request.headers["some-important-header"] = Inputs.ImportantHeader;
|
||||
Request.content = {
|
||||
"send-me": Inputs.SendMe,
|
||||
};
|
||||
```
|
||||
|
||||
When the request is completed and we have a response the corresponding response function will be invoked.
|
||||
|
||||
### Response
|
||||
|
||||
In the response function, you can parse the response and set the appropriate outputs of the REST node using the _Outputs_ map
|
||||
provided as an argument to the _response_ function. In the function, you will also have access to an object called _Response_ with the following content.
|
||||
|
||||
- _status_ - The status code of the response.
|
||||
- _content_ - The content of the response.
|
||||
- _request_ - This contains the request object from the _request_ function above that was used to make the request.
|
||||
|
||||
The REST node looks at the `Content-Type` header to determine how to parse the response from the server. If the type is JSON it will use `JSON.parse` and for XML it'll convert it to a JavaScript object.
|
||||
|
||||
#### Array Example
|
||||
|
||||
The following example assumes the response content is an array of objects.
|
||||
It is converted to a Noodl Array with Noodl Objects and sends it to the output **Items**.
|
||||
|
||||
Example Response Content:
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"MyValue": 1
|
||||
},
|
||||
{
|
||||
"MyValue": 2
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
Script:
|
||||
|
||||
```javascript
|
||||
Outputs.Items = Response.content.map((o) => Noodl.Object.create(o));
|
||||
```
|
||||
|
||||
**Items** is now an array that can be sent to a Repeater or used in another node.
|
||||
|
||||
#### Object Example
|
||||
|
||||
The following example assumes the response content is an object.
|
||||
It converts the object to a Noodl Object and sends it to the output **Items**.
|
||||
|
||||
Example Response Content:
|
||||
|
||||
```json
|
||||
{
|
||||
"title": "my title",
|
||||
"description": "my cool description"
|
||||
}
|
||||
```
|
||||
|
||||
Script:
|
||||
|
||||
```javascript
|
||||
Outputs.Item = Noodl.Object.create(Response.content);
|
||||
```
|
||||
|
||||
We can also call `Response.content.description` immediately to extract certain properties.
|
||||
|
||||
## Inputs
|
||||
|
||||
| Signal | Description |
|
||||
| ------------------------------------------ | --------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Fetch</span> | Connect a signal to this input to trigger a request. |
|
||||
| <span className="ndl-signal">Cancel</span> | Send a signal to this input to cancel an ongoing request. |
|
||||
|
||||
| Data | Description |
|
||||
| ------------------------------------------ | ------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Resource</span> | This is the resource endpoint that the REST request will use, i.e. the url. |
|
||||
| <span className="ndl-data">Method</span> | This is the method that will be used for the request. Supported methods are GET, PUT, POST, PATCH and DELETE. |
|
||||
| <span className="ndl-data">Request</span> | Here you can edit the request script. |
|
||||
| <span className="ndl-data">Response</span> | Here you can edit the response script. |
|
||||
|
||||
### Request and response inputs
|
||||
|
||||
Any variable of the **Inputs** object that you access in your scrips will automatically become an input of the node.
|
||||
|
||||
## Outputs
|
||||
|
||||
| Signal | Description |
|
||||
| ------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Success</span> | A signal will be emitted on this output if the request receives a successful status code (2XX). |
|
||||
| <span className="ndl-signal">Failure</span> | A signal will be emitted on this output on all other status codes of if another type of failure occurs. |
|
||||
| <span className="ndl-signal">Canceled</span> | A signal will be emitted on this output if the request was canceled. |
|
||||
|
||||
### Request and response outputs
|
||||
|
||||
Any variable of the **Outputs** object that you access in your scrips will automatically become an output of the node.
|
||||
89
nodes/data/run-tasks.md
Normal file
89
nodes/data/run-tasks.md
Normal file
@@ -0,0 +1,89 @@
|
||||
---
|
||||
hide_title: true
|
||||
hide_table_of_contents: true
|
||||
title: Run Tasks
|
||||
---
|
||||
|
||||
<##head##>
|
||||
|
||||
# Run Tasks
|
||||
|
||||
This node can be used to perform a set of tasks comprised of a logic component for each item in an <span className="ndl-data">array</span>. These tasks can be perfomed in a parallel or waterfall fashion. You start running the tasks by sending a signal to the **Do** input of the **Run Tasks** node.
|
||||
|
||||
<div className="ndl-image-with-background xl">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
The <span className="ndl-node">Run Tasks</span> node needs a task component that it will "run" for each item in the array connected to **Items**. These tasks are logic components that are started with the **Do** signal and that need to complete with a signal either to **Success** or **Failure**.
|
||||
|
||||
<div className="ndl-image-with-background xl">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
<##head##>
|
||||
|
||||
You can control the behaviour of how the tasks are run with the properties.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
* **Stop On Failure** Indicates wether the run tasks node should stop on the first task that signals a **Failure**. This will result in the **Failure** signal and **Aborted** signal emitted from the **Run Tasks** node.
|
||||
|
||||
* **Max Running Tasks** Specifies the maximum number of tasks that will run at the same time. If you want each task to be performed in order and wait for a task to be completed before starting a new you set this value to **1**. When running tasks in parallel which is often the case then you may want to limit the number of tasks running concurrently.
|
||||
|
||||
* **Template** This is the logic component that will be used to run each task.
|
||||
|
||||
**Run Tasks** work a lot like the [Repeater](/nodes/ui-controls/repeater) node where each task instance can access the data from the corresponding item in the array using an [Object](/nodes/data/object/object-node) or [Record](/nodes/data/cloud-data/record) node.
|
||||
|
||||
<div className="ndl-image-with-background xl">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
As with the **Repeater** you need to specify that the **Id** of the object should be obtained from the repeater, in this case the **Run Tasks** is the repeater and the object will be the item on the array corresponing to this task component instance.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
However the properties of the object corresponding to that task will also be available as **Component Inputs** directly. So a quicker way might be to just add corresponding inputs.
|
||||
|
||||
<div className="ndl-image-with-background xl">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
## Inputs
|
||||
|
||||
| Data | Description |
|
||||
| ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Template</span> | This is a reference to a component that will be cloned for each item in the **Items** array and used to run the task for that item. |
|
||||
| <span className="ndl-data">Stop On Failure</span> | Indicates wether the run tasks node should stop on the first task that signals a <span className="ndl-signal">Failure</span>. This will result in the <span className="ndl-signal">Failure</span> signal and <span className="ndl-signal">Aborted</span> signal emitted from the **Run Tasks** node. |
|
||||
| <span className="ndl-data">Max Running Tasks</span> | Specifies the maximum number of tasks that will run at the same time. If you want each task to be performed in order and wait for a task to be completed before starting a new you set this value to **1**. When running tasks in parallel which is often the case then you may want to limit the number of tasks running concurrently. |
|
||||
| <span className="ndl-data">Items</span> | An array of objects. The run tasks will create a task component instance for each item in the array that may run a task. |
|
||||
|
||||
| Signal | Description |
|
||||
| ------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Do</span> | Send a signal on this input to start running the tasks. |
|
||||
| <span className="ndl-signal">Abort</span> | Sending a signal on this input will abort the running of tasks, when the currently running tasks are completed no new tasks will be started. |
|
||||
|
||||
|
||||
## Outputs
|
||||
|
||||
| Signal | Description |
|
||||
| ------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Success</span> | A signal will be emitted on this output when all tasks have completed successfully. |
|
||||
| <span className="ndl-signal">Failure</span> | A signal will be emitted here when the tasks have completed running and a task failed. |
|
||||
| <span className="ndl-signal">Aborted</span> | A signal here indicated that the running of tasks was aborted eihter due to a signal on the <span className="ndl-signal">Abort</span> input or that a task failed and the running of tasks was stopped. |
|
||||
| <span className="ndl-signal">Done</span> | A signal is emitted here when all tasks have been completed, failed and succeeded. |
|
||||
68
nodes/data/string.md
Normal file
68
nodes/data/string.md
Normal file
@@ -0,0 +1,68 @@
|
||||
---
|
||||
hide_title: true
|
||||
hide_table_of_contents: true
|
||||
title: String
|
||||
---
|
||||
|
||||
<##head##>
|
||||
|
||||
# String
|
||||
|
||||
This node contains a <span className="ndl-data">string</span> value (text). It can be provided with static data or be dynamically set from other nodes. The <span className="ndl-node">String</span> node is often used to convert other data types to a <span className="ndl-data">string</span> or to hold string values.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
You can also use the String node connected to a <span className="ndl-node">Component Inputs</span> node. This will make sure the input shows up as a <span className="ndl-data">string</span> input in the Property Panel for instances of this component.
|
||||
|
||||
<##head##>
|
||||
|
||||
You can use it to provide a static value for input to other nodes. It is local to the component and cannot be accessed anywhere else in the graph.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
You can simply connect to the **Value** input to set the value of the node when the connection is updated.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
Using a variable node like above will make the **Text** component input show up as a string in the property editor of all instances of this component.
|
||||
|
||||
You can also use the **Set** input to control when the value of the variable node is updated. In the setup below the value is only updated when the **Text Input** node is blurred.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
## Inputs
|
||||
|
||||
| Data | Description |
|
||||
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| <span className="ndl-data">Value</span> | The value to store in the node. The output value will equal this value, unless _Set_ is connected, then the value will be passed to the output when a signal is sent to _Set_. |
|
||||
|
||||
| Signal | Description |
|
||||
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Set</span> | This is used to only update the output when a signal is received. This will allow you to freeze the stored value and only allow it to update under certain conditions, e.g. on a Tap. |
|
||||
|
||||
## Outputs
|
||||
|
||||
| Data | Description |
|
||||
| ---------------------------------------- | --------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Value</span> | The string (text) stored in the node. |
|
||||
| <span className="ndl-data">Length</span> | The length of the string (text) stored in the node, i.e. the number of characters and spaces. |
|
||||
|
||||
| Signal | Description |
|
||||
| ------------------------------------------ | ----------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Stored</span> | This port sends a signal when the value is updated via the _Set_ input. |
|
||||
49
nodes/data/user/log-in.md
Normal file
49
nodes/data/user/log-in.md
Normal file
@@ -0,0 +1,49 @@
|
||||
---
|
||||
hide_title: true
|
||||
hide_table_of_contents: true
|
||||
title: Log In
|
||||
---
|
||||
|
||||
<##head##>
|
||||
|
||||
# Log In
|
||||
|
||||
This node is used to log in users that exist in the Noodl Cloud Service. You need to provide a <span className="ndl-data">Username</span> and a <span className="ndl-data">Password</span> and then send a signal to the <span className="ndl-signal">Do</span> action.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
Once a user is logged in, their data can be accessed through the <span className="ndl-data">User</span> node.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
<##head##>
|
||||
|
||||
## Inputs
|
||||
|
||||
| Data | Description |
|
||||
| ------------------------------------------ | --------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Username</span> | <##input:username##>The username of the user that should be logged in.<##input##> |
|
||||
| <span className="ndl-data">Password</span> | <##input:password##>The password of the user that should be logged in.<##input##> |
|
||||
|
||||
| Signal | Description |
|
||||
| -------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Do</span> | <##input:do##>Send a signal to this action to log in the user. You need to make sure the **Username** and **Password** is connected, these will be sent to the backend for authentication.<##input##> |
|
||||
|
||||
## Outputs
|
||||
|
||||
| Signal | Description |
|
||||
| ------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Success</span> | <##output:success##>This event will be triggered if the log in was succesful.<##output##> |
|
||||
| <span className="ndl-signal">Failure</span> | <##output:failure##>This event will be triggered if something went wrong while trying to log in the user. The error message can be found in the **Error** output.<##output##> |
|
||||
|
||||
| Data | Description |
|
||||
| --------------------------------------- | ---------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Error</span> | <##output:error##>This output will contain the error message if the log in failed.<##output##> |
|
||||
36
nodes/data/user/log-out.md
Normal file
36
nodes/data/user/log-out.md
Normal file
@@ -0,0 +1,36 @@
|
||||
---
|
||||
hide_title: true
|
||||
hide_table_of_contents: true
|
||||
title: Log Out
|
||||
---
|
||||
|
||||
<##head##>
|
||||
|
||||
# Log Out
|
||||
|
||||
This node is used to log out a user from the current session. That means that the <span className="ndl-data">User</span> node will no longer be able to access user data and that it will trigger the <span className="ndl-signal">Logged Out</span> event as well as the <span className="ndl-data">Authenticated</span> output will be false.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
<##head##>
|
||||
|
||||
## Inputs
|
||||
|
||||
| Signal | Description |
|
||||
| -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Do</span> | <##input:do##>Send a signal to this action to logout the user. The user session will be removed from the browser.<##input##> |
|
||||
|
||||
## Outputs
|
||||
|
||||
| Signal | Description |
|
||||
| ------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Success</span> | <##output:success##>This event will be triggered if the logout was succesful.<##output##> |
|
||||
| <span className="ndl-signal">Failure</span> | <##output:failure##>This event will be triggered if something went wrong while trying to logout the user. The error message can be found in the **Error** output.<##output##> |
|
||||
|
||||
| Data | Description |
|
||||
| --------------------------------------- | ----------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Error</span> | <##output:error##>This output will contain the error message if the log out failed.<##output##> |
|
||||
42
nodes/data/user/set-user-properties.md
Normal file
42
nodes/data/user/set-user-properties.md
Normal file
@@ -0,0 +1,42 @@
|
||||
---
|
||||
hide_title: true
|
||||
hide_table_of_contents: true
|
||||
title: Set User Properties
|
||||
---
|
||||
|
||||
<##head##>
|
||||
|
||||
# Set User Properties
|
||||
|
||||
This node is used to set properties on the currently logged in user.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
A user needs to be logged in via either the <span className="ndl-node">Sign Up</span> node or the <span className="ndl-node">Log In</span> node. If you want to read user properties of the currently logged in user you can use the <span className="ndl-node">User</span> node.
|
||||
<##head##>
|
||||
|
||||
## Inputs
|
||||
|
||||
| Data | Description |
|
||||
| -------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Email</span> | <##input:email##>This input is used to set the **Email** property.<##input##> |
|
||||
| <span className="ndl-data">Your custom properties</span> | <##input:prop-\*##>A property of the **User** class. You can add additional properties to the **User** class in the Noodl Cloud Services dashboard. <##input##> These will show up as inputs on the **Set User Properties** node. |
|
||||
|
||||
| Signal | Description |
|
||||
| -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Do</span> | <##input:do##>Send a signal to this input to store the properties in the user record in the Noodl Cloud Services. Once completed the **Success** or **Failure** action will be triggered.<##input##> |
|
||||
|
||||
## Outputs
|
||||
|
||||
| Signal | Description |
|
||||
| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Success</span> | <##output:success##>This event will be triggered if the properties was succesfully stored.<##output##> |
|
||||
| <span className="ndl-signal">Failure</span> | <##output:failure##>This event will be triggered if something went wrong while trying to store the properties on the **User** record in the Noodl Cloud Services. The error message can be found in the **Error** output.<##output##> |
|
||||
|
||||
| Data | Description |
|
||||
| --------------------------------------- | ---------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Error</span> | <##output:error##>This output will contain the error message if the action failed.<##output##> |
|
||||
51
nodes/data/user/sign-up.md
Normal file
51
nodes/data/user/sign-up.md
Normal file
@@ -0,0 +1,51 @@
|
||||
---
|
||||
hide_title: true
|
||||
hide_table_of_contents: true
|
||||
title: Sign Up
|
||||
---
|
||||
|
||||
<##head##>
|
||||
|
||||
# Sign Up
|
||||
|
||||
This node is used to sign up new users in the Noodl Cloud Service.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
The <span className="ndl-node">Sign Up</span> node is the easiest way to handle users in a Noodl web app. Once a user is created with this node, they can log in through the <span className="ndl-node">Log In</span> node and you can access user information via the <span className="ndl-node">User</span> node.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
<##head##>
|
||||
|
||||
## Inputs
|
||||
|
||||
| Data | Description |
|
||||
| -------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Username</span> | <##input:username##>This is the username of the new user that is going to sign up. It is required that this input has a value and it must be unique, or the sign up will fail.<##input##> |
|
||||
| <span className="ndl-data">Password</span> | <##input:password##>This input should contain the password for the new user.<##input##> |
|
||||
| <span className="ndl-data">Email</span> | <##input:email##>Optionally the new user can be given assigned an email.<##input##> |
|
||||
| <span className="ndl-data">Your custom properties</span> | <##input:prop-\*##>A property of the **User** class. You can add additional properties to the **User** class in the Noodl Cloud Services dashboard. <##input##> These will show up as inputs on the **Sign Up** node to optionally bhe given a value during sign up. |
|
||||
|
||||
| Signal | Description |
|
||||
| -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Do</span> | <##input:do##>Send a signal to this action to trigger the sign up. Once completed the **Success** or **Failure** event will be triggered.<##input##> |
|
||||
|
||||
## Outputs
|
||||
|
||||
| Signal | Description |
|
||||
| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Success</span> | <##output:success##>This action will be triggered if the sign up was succesful. The user is now logged in and information about the user can be accessed via the **User** node.<##output##> |
|
||||
| <span className="ndl-signal">Failure</span> | <##output:failure##>This action will be triggered if something went wrong while trying to sign up the user. The error message can be found in the **Error** output.<##output##> |
|
||||
|
||||
| Data | Description |
|
||||
| --------------------------------------- | ----------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Error</span> | <##output:error##>This output will contain the error message if the sign up failed.<##output##> |
|
||||
54
nodes/data/user/user-node.md
Normal file
54
nodes/data/user/user-node.md
Normal file
@@ -0,0 +1,54 @@
|
||||
---
|
||||
hide_title: true
|
||||
hide_table_of_contents: true
|
||||
title: User
|
||||
---
|
||||
|
||||
<##head##>
|
||||
|
||||
# User
|
||||
|
||||
This node provides information about the current user session, if the web app has a logged in user.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
The <span className="ndl-node">User</span> node only works if the user is created in the project’s Noodl Cloud Service, and is logged in via the <span className="ndl-node">Log In</span> node.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
<##head##>
|
||||
|
||||
## Inputs
|
||||
|
||||
| Signal | Description |
|
||||
| ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Fetch</span> | <##input:fetch##>Send a signal to this input to fetch the user properties for the current logged in user from the Noodl Cloud Services. There must be a valid user session for this to work.<##input##> |
|
||||
|
||||
## Outputs
|
||||
|
||||
| Data | Description |
|
||||
| -------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Id</span> | <##output:id##>The **Id** of the User record for the current logged in user.<##output##> |
|
||||
| <span className="ndl-data">Username</span> | <##output:username##>The **Username** of the current logged in user.<##output##> |
|
||||
| <span className="ndl-data">Email</span> | <##output:email##>The **Email** of the current logged in user, if the user has an email stored.<##output##> |
|
||||
| <span className="ndl-data">Authenticated</span> | <##output:authenticated##>This output will be true if a valid user session exists in the browser, i.e. there is a logged in user.<##output##> |
|
||||
| <span className="ndl-data">Error</span> | <##output:error##>If a **Fetch** action failed to retrieve the user information from the Noodl Cloud Services this output will contain the error message.<##output##> |
|
||||
| <span className="ndl-data">Your custom properties</span> | <##output:prop-\*##>The value of extra properties of the **User** class specified in the Noodl Cloud Services.<##output##> The node will contain the latest value of all user properties. |
|
||||
|
||||
| Signal | Description |
|
||||
| -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Fetched</span> | <##output:fetched##>This signal is triggered after a **Fetch** has been successfully performed. That is the **Fetch** action is triggered by a signal and the user data is return from the Noodl Cloud Services.<##output##> |
|
||||
| <span className="ndl-signal">Changed</span> | <##output:changed##>This signal is triggered when the User is changed locally by a **Set User Properties** node or a **Fetch** action of a **User** node.<##output##> |
|
||||
| <span className="ndl-signal">Failure</span> | <##output:failure##>This signal is triggered when a **Fetch** action failed to retrieve the latest user data from the Noodl Cloud Services. This could be due to an invalid session.<##output##> |
|
||||
| <span className="ndl-signal">Logged In</span> | <##output:logged in##>This signal is triggered when a user has been successfully logged in.<##output##> |
|
||||
| <span className="ndl-signal">Logged Out</span> | <##output:logged out##>This signal is triggered when a user has been successfully logged out.<##output##> |
|
||||
| <span className="ndl-signal">Session Lost</span> | <##output:session lost##>This signal is triggered when the current user session becomes invalid, e.g. if it has timed out.<##output##> |
|
||||
| <span className="ndl-signal">Changed events</span> | <##output:changed-\*##>This signal will be triggered when the property is changed using the **Set User Property** node or when the latest user data is retrieved from the Noodl Cloud Services with the **Fetch** action.<##output##> |
|
||||
36
nodes/data/variable/set-variable.md
Normal file
36
nodes/data/variable/set-variable.md
Normal file
@@ -0,0 +1,36 @@
|
||||
---
|
||||
hide_title: true
|
||||
hide_table_of_contents: true
|
||||
title: Set Variable
|
||||
---
|
||||
|
||||
<##head##>
|
||||
|
||||
# Set Variable
|
||||
|
||||
This node sets the **Value** of a [Variable](/nodes/data/variable/variable-node). You provide the new value on the **Value** input and trigger the <span className="ndl-signal">Do</span> action.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
<##head##>
|
||||
|
||||
## Inputs
|
||||
|
||||
| Data | Description |
|
||||
| --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Name</span> | <##input:name##>The name of the **Variable** to set. Note: All **Variable** nodes with the same name will share the same data.<##input##> |
|
||||
| <span className="ndl-data">Value</span> | <##input:value##>The value that you want the **Variable** to get when you trigger the <span className="ndl-signal">Do</span> action.<##input##> |
|
||||
|
||||
| Signal | Description |
|
||||
| -------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Do</span> | <##input:do##>Updates the value of the **Variable** to what is currently set on the input **Value**.<##input##> |
|
||||
|
||||
## Outputs
|
||||
|
||||
| Signal | Description |
|
||||
| ---------------------------------------- | ----------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Done</span> | <##output:done##>This event is triggered when the **Variable** have been set.<##output##> |
|
||||
52
nodes/data/variable/variable-node.md
Normal file
52
nodes/data/variable/variable-node.md
Normal file
@@ -0,0 +1,52 @@
|
||||
---
|
||||
hide_title: true
|
||||
hide_table_of_contents: true
|
||||
title: Variable
|
||||
---
|
||||
|
||||
<##head##>
|
||||
|
||||
# Variable
|
||||
|
||||
Use this node to store a single data variable that will be globally accessible throughout the application. **Variable** works in a similar way as [Object](/nodes/data/object/object-node) but can only store one value.
|
||||
|
||||
<div className="ndl-image-with-background l">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
The value can be dynamically stored, either by passing it a new value or by sending <span className="ndl-signal">signals</span> to the <span className="ndl-node">[Set Variable](/nodes/data/variable/set-variable)</span> node.
|
||||
|
||||
<##head##>
|
||||
|
||||
## Storing a value
|
||||
|
||||
Give the Variable a name with the **Name** input and simply connect to **Value**, whenever the input connection is updated the value will be stored in the variable. You can also use the [Set Variable](/nodes/data/variable/set-variable) node to update tha value of a **Variable**. In this case, you control when the value is stored by sending a signal to the <span className="ndl-signal">Do</span> action.
|
||||
|
||||
## Use a stored value
|
||||
|
||||
When a value is stored in a variable you can use it somewhere else in your application simply be creating a new node and giving it the same **Name** and connecting the **Value** property.
|
||||
|
||||
## Inputs
|
||||
|
||||
| Data | Description |
|
||||
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| <span className="ndl-data">Name</span> | <##input:name##>The name of the **Variable**. All **Variable** nodes with the same name will share the same data.<##input##> |
|
||||
| <span className="ndl-data">Value</span> | <##input:value##>The value that you want the **Variable** to get. You will connect your data to this input. The value of the **Variable** will change when the data changes. If you want to control more precisely when the value should be updated, you should use the [Set Variable](/nodes/data/variable/set-variable) node.<##input##> |
|
||||
|
||||
| Signal | Description |
|
||||
| ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| <span className="ndl-signal">Fetch</span> | <##input:fetch##>Normally the value output of the node is updated once the **Name** input is set and if there is a change in the data from somewhere in the graph. However, if this signal has a connection it will wait until it gets a signal on **Fetch** before it updates.<##input##> |
|
||||
|
||||
## Outputs
|
||||
|
||||
| Data | Description |
|
||||
| --------------------------------------- | -------------------------------------------------------------------------- |
|
||||
| <span className="ndl-data">Value</span> | <##output:value##>The current value of this **Variable** node.<##output##> |
|
||||
| <span className="ndl-data">Name</span> | <##output:name##>The name of the **Variable**.<##output##> |
|
||||
|
||||
| Signal | Description |
|
||||
| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="ndl-signal">Changed</span> | <##output:changed##>This signal is sent when the **Value** of this **Variable** has changed. Note: The signal triggers when any **Variable** with the same **Name** is changed, i.e. it triggers when the underlying data has changed.<##output##> |
|
||||
| <span className="ndl-signal">Fetched</span> | <##output:fetched##>Signal when the data of this **Variable** node has been fetched and updated, either as a response to the **Fetch** input signal (when it has completed and the output **Value** is updated), or when the **Name** of the variable have changed.<##output##> |
|
||||
Reference in New Issue
Block a user