Skip to content

Commit 6a61113

Browse files
committed
Review: Reorganize the structure
1 parent 1717157 commit 6a61113

File tree

1 file changed

+52
-14
lines changed

1 file changed

+52
-14
lines changed

content/en/docs/refguide/modeling/application-logic/microflows-and-nanoflows/return-value-mapping.md

Lines changed: 52 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,34 +7,72 @@ weight: 60
77

88
## Introduction
99

10-
Pages and snippets can use [return values](/refguide/end-event/#return-value) when calling microflows or nanoflows by specifying a return value mapping. This feature enhances microflow and nanoflow reusability by allowing pages to update local values based on flow return values without needing to pass objects containing those attributes to the flow.
10+
Pages and snippets can use [return values](/refguide/end-event/#return-value) when calling microflows or nanoflows by specifying a return value mapping. This feature enhances microflow and nanoflow reusability by allowing pages to decide how to use return values. Previously, modifying values on the page from a microflow or nanoflow required an additional entity passed as a parameter, resulting in many page-specific variations of the same logic.
1111

1212
Return values can be mapped to available variables on the page or snippet. Both primitive and object return value types are supported. Using an expression, the return value can be transformed as needed before assignment.
1313

14+
You can add more than one return value mapping to the same flow call. This is particularly useful when assigning multiple computed values to different variables from the same return value.
15+
1416
{{< figure src="/attachments/refguide/modeling/application-logic/microflows-and-nanoflows/parameter/return-value-mapping-list.png" width="500px" class="no-border" >}}
1517

16-
## Primitive Return Values
18+
## Supported Return Values
19+
20+
Return value mapping supports both primitive values and objects from the microflow or nanoflow return value.
1721

18-
For primitive return values (such as strings, booleans, integers, decimals, or enumerations), the value can be assigned to any matching attribute of available objects on the page, or to variables and parameters of pages or snippets. The target must have a compatible data type with the return value.
22+
### Supported Primitive Types
1923

20-
## Object Return Values
24+
The following primitive types can be mapped directly:
2125

22-
When a microflow or nanoflow returns an object, you can specify a return value mapping using one or more attributes of that object. This capability makes it possible to dynamically update multiple attributes, variables, and parameters with the return value of a single flow.
26+
* Boolean
27+
* Date and time
28+
* Decimal
29+
* Enumeration
30+
* Integer/Long
31+
* String
2332

24-
To use multiple attributes from a returned object, add more than one return value mapping to the same flow call. This is particularly useful when assigning multiple computed values to different variables from the same return value.
33+
### Object Attributes
2534

26-
## Mapping Return Values from a Page
35+
When a microflow or nanoflow returns an object, you can select specific attributes from that object. This allows you to extract individual values from the returned object without needing to work with the entire object on the page.
2736

28-
When calling a microflow or nanoflow action, you can map return values in two primary ways.
37+
{{< figure src="/attachments/refguide/modeling/application-logic/microflows-and-nanoflows/parameter/variable-return-value-mapping.png" width="500px" class="no-border" >}}
2938

30-
### Variable Return Value Mappings
39+
### Lists Not Supported
3140

32-
Variable return value mappings are used to map values returned by the microflow or nanoflow directly. When the flow returns an object, you can select specific attributes from that object to assign to variables on the page or snippet.
41+
Return value mapping does not support list return values. If your microflow or nanoflow returns a list, you cannot use return value mapping to capture it.
3342

34-
{{< figure src="/attachments/refguide/modeling/application-logic/microflows-and-nanoflows/parameter/variable-return-value-mapping.png" width="500px" class="no-border" >}}
43+
## Transforming Return Values
44+
45+
You can use expressions to transform return values before they are assigned. In the expression, the return value is available as `$ActionReturnValue`.
46+
47+
When the microflow or nanoflow returns an object, you can access attributes using `$ActionReturnValue/AttributeName`. This allows you to apply transformations to attributes, before assigning the value.
48+
49+
{{< figure src="/attachments/refguide/modeling/application-logic/microflows-and-nanoflows/parameter/expression-return-value-mapping.png" width="500px" class="no-border" >}}
50+
51+
**Example:**
52+
53+
If a microflow returns an **Order** object with a **TotalAmount** attribute (Decimal), you can format it as currency before assigning it to a string page variable:
54+
55+
```
56+
formatDecimal($ActionReturnValue/TotalAmount, '$#,##0.00')
57+
```
58+
59+
## Page Variable Assignment
60+
61+
Return values can be assigned to various targets available on the page or snippet.
62+
63+
### Available Targets
64+
65+
The following targets are available for return value mapping:
66+
67+
* **Page and snippet variables** – Variables defined on the current page or snippet
68+
* **Page and snippet parameters** – Parameters of the current page or snippet
69+
* **Attributes of objects on the page** – Attributes of objects available in data views or other data containers on the page
3570

36-
### Expression-Based Return Value Mappings
71+
### Type Matching
3772

38-
Both primitive values and object attributes can be mapped using expressions. This method allows you to use functions within the expression to modify the return value before it is assigned.
73+
The target variable or attribute must have a compatible data type with the return value. When using expressions, the result type of the expression must match the target type.
3974

40-
{{< figure src="/attachments/refguide/modeling/application-logic/microflows-and-nanoflows/parameter/expression-return-value-mapping.png" width="500px" class="no-border" >}}
75+
For example:
76+
* A decimal return value can be assigned directly to a decimal page variable
77+
* A decimal return value can be transformed with an expression like `formatDecimal($ActionReturnValue, '#,##0.00')` and assigned to a string page variable
78+
* An object attribute can be extracted and assigned to a matching primitive variable

0 commit comments

Comments
 (0)