Skip to content

Commit a992827

Browse files
committed
Merge remote-tracking branch 'origin/feature/23267-decomposition-of-output-properties' into feature/2024.9/23110-release-notes-whats-new
2 parents 86a5aa1 + d1c2644 commit a992827

File tree

1 file changed

+66
-1
lines changed

1 file changed

+66
-1
lines changed

content/en/docs/2024.9/Reference/Concepts/fundamentals/blocks/block-properties/what-is-a-block-property.md

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ The icons used for Input properties are dark blue to distinguish them from [Outp
3737

3838
### Output Properties
3939

40-
Output properties are used to save values from a [block][]. These properties will saved to a variable during the block's execution.
40+
Output properties are used to save values from a [block][]. These properties can be saved to a variable or decomposed to be saved into multiple variables during the block's execution.
4141

4242
Values from Output properties can be [discarded][Discarding Outputs], this means they will not be saved to any variable.
4343

@@ -51,6 +51,71 @@ Output properties can be configured using the following editors:
5151

5252
The icon used for Output properties are light blue to distinguish them from [Input Properties][].
5353

54+
#### Decomposing Output Properties
55+
56+
Output values can be decomposed to allow the saving of different parts of the value to different variables.
57+
58+
To decompose an output value, the output property will need to be set to an expression. As an example, an output value value contains a Json object, e.g:
59+
60+
``` json
61+
{
62+
"company": {
63+
"name": "Company Name",
64+
"department": [
65+
{
66+
"name": "HR",
67+
"employees": [
68+
{
69+
"name": "Joe Blogs",
70+
"id": "101"
71+
},
72+
{
73+
"name": "Jane Doe",
74+
"id": "102"
75+
}
76+
]
77+
}
78+
]
79+
}
80+
}
81+
```
82+
83+
To decompose this structure and store a part of the value to a variable, e.g. to get the employees for the first department, the syntax would be:
84+
85+
```text
86+
{"$.company.department[0].employees": ($)VariableNameToStore}
87+
```
88+
89+
In this example, this would set the variable to be:
90+
91+
```json
92+
{
93+
{
94+
"name": "Joe Blogs",
95+
"id": "101"
96+
},
97+
{
98+
"name": "Jane Doe",
99+
"id": "102"
100+
}
101+
}
102+
```
103+
104+
To set the variable to the last value `-1` should be used for the index:
105+
106+
```text
107+
{"$.company.department[0].employees[-1]": ($)VariableNameToStore}
108+
```
109+
110+
In this example, this would set the variable to be:
111+
112+
```json
113+
{
114+
"name": "Jane Doe",
115+
"id": "102"
116+
}
117+
```
118+
54119
#### Discarding Outputs
55120

56121
Output values can be discarded, instead of saving them to a variable.

0 commit comments

Comments
 (0)