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:
Eric Tuvesson
2023-09-05 12:08:55 +02:00
commit 53f0d6320e
2704 changed files with 76354 additions and 0 deletions

View 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">
![](/nodes/data/array/array-filter/array-filter.png)
</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">
![](/nodes/data/array/array-filter/collection-filter.png)
</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">
![](/nodes/data/array/array-filter/collection-filter-2.png)
</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">
![](/nodes/data/array/array-filter/collection-sort.png)
</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##> |

View 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">
![](/nodes/data/array/array-map/array-map.png)
</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##> |

View 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">
![](/nodes/data/array/array/array.png)
</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##> |

View 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">
![](/nodes/data/array/clear-array/clear-array.png)
</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##> |

View 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">
![](/nodes/data/array/create-new-array/create-new-array.png)
</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##> |

View 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">
![](/nodes/data/array/insert-into-array/insert-object-into-array.png)
</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##> |

View 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">
![](/nodes/data/array/remove-from-array/remove-object-from-array.png)
</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##> |

View 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">
![](/nodes/data/array/static-array/static-array-1.png)
</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##> |