Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not a big fan of the current outline. I would suggest the following:

  • Introduction
    • (can stay mostly the same, but include a paragraph on adding multiple mappings)
  • Supported Return Values
    • Supported Primitive Types
    • Object Attributes
    • Lists not supported
  • Transforming Return Values
    • Explain how the $ActionReturnValue is used
  • Page Variable Assignment
    • What page variables are available as targets
    • Type matching (and how expressions can affect this)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice rewrite ✅

Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
title: "Return Value Mapping"
url: /refguide/return-value-mapping/
weight: 60
#If moving or renaming this doc file, implement a temporary redirect and let the respective team know they should update the URL in the product. See Mapping to Products for more details.
---

## Introduction

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.

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.

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.

{{< figure src="/attachments/refguide/modeling/application-logic/microflows-and-nanoflows/parameter/return-value-mapping-list.png" width="500px" class="no-border" >}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would move the part about multiple return mappings here. It is currently mentioned under Object Return Values, but it applies to Primitive Return Values as well.

Copy link
Contributor

@weirdwater weirdwater Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thank you. I cannot resolve the thread, so: ✅


## Supported Return Values

Return value mapping supports both primitive values and objects from the microflow or nanoflow return value.

### Supported Primitive Types

The following primitive types can be mapped directly:

* Boolean
* Date and time
* Decimal
* Enumeration
* Integer/Long
* String

### Object Attributes

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.

{{< figure src="/attachments/refguide/modeling/application-logic/microflows-and-nanoflows/parameter/variable-return-value-mapping.png" width="500px" class="no-border" >}}

### Lists Not Supported

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.

## Transforming Return Values

You can use expressions to transform return values before they are assigned. In the expression, the return value is available as `$ActionReturnValue`.

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.

{{< figure src="/attachments/refguide/modeling/application-logic/microflows-and-nanoflows/parameter/expression-return-value-mapping.png" width="500px" class="no-border" >}}

**Example:**

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:

```
formatDecimal($ActionReturnValue/TotalAmount, '$#,##0.00')
```

## Page Variable Assignment

Return values can be assigned to various targets available on the page or snippet.

### Available Targets

The following targets are available for return value mapping:

* **Page and snippet variables** – Variables defined on the current page or snippet
* **Page and snippet parameters** – Parameters of the current page or snippet
* **Attributes of objects on the page** – Attributes of objects available in data views or other data containers on the page

### Type Matching

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.

For example:
* A decimal return value can be assigned directly to a decimal page variable
* A decimal return value can be transformed with an expression like `formatDecimal($ActionReturnValue, '#,##0.00')` and assigned to a string page variable
* An object attribute can be extracted and assigned to a matching primitive variable
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.