diff --git a/content/en/docs/refguide/modeling/pages/page/page-parameter.md b/content/en/docs/refguide/modeling/pages/page/page-parameter.md new file mode 100644 index 00000000000..1bb8946e2c9 --- /dev/null +++ b/content/en/docs/refguide/modeling/pages/page/page-parameter.md @@ -0,0 +1,58 @@ +--- +title: "Page Parameters" +url: /refguide/page-parameter/ +weight: 70 +#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 + +Parameters are the means by which you pass data to your page. When a page is loaded, the parameters are filled with the current values. + +To use an object or primitive value in your page, define a parameter. In the image below, the parameter is named **CustomerName**, is of type string, is not required, and has a default value of an empty string `''`. + +{{< figure src="/attachments/refguide/modeling/pages/page/page-parameter.png" class="no-border" >}} + +## Mappings + +### Name + +**Name** refers to the name of the parameter. + +### Data Type + +The data type of a parameter defines the type of the value that it expects. Possible data types are **objects**, and **primitives** such as `Boolean`, `Date and time`, `Decimal`, `Enumeration`, `Integer/Long`, and `String`. + +Default: *Object* + +### Argument {#argument} + +Argument determines whether it is **required** or **optional** to [pass an argument](/refguide/page-parameter/#passing-arguments) to the parameter when opening the page. If it is required it is mandatory to supply an argument for that parameter when opening a page. + +### Default Value + +When an argument is set to **optional**, a default value can be set. When a default value is set if the parameter is omitted, the default value will be used. In the example below, if the parameter is omitted by the user an empty string `''` will be used for the parameter. + +{{< figure src="/attachments/refguide/modeling/pages/page/page-parameter-default-value.png" max-width=70% >}} + +{{% alert color="info" %}} +The default value is used when the argument is omitted during **modeling**. Not when the argument value is `empty` during **runtime**. +{{% /alert %}} + +## Passing Arguments {#passing-arguments} + +Arguments are passed to page parameters when a page is opened. For example, using a **Show page** action [on a widget event](/refguide/on-click-event/#show-page) or in a [microflow](/refguide/show-page/). For each parameter the page has an argument can be configured. It is only necessary to pass arguments to [required parameters](#argument). + +{{< figure src="/attachments/refguide/modeling/pages/page/page-parameter-mappings.png" width="500px" >}} + +### Variable Arguments + +Variable arguments are used to pass parameters from the context to the page. This is done by selecting from the available variables on the page presented in the dropdown. **Optional** parameters don't require an argument and can be omitted by selecting `(None)` . + +{{< figure src="/attachments/refguide/modeling/pages/page/page-parameter-argument-variable.png" max-width=70% >}} + +### Expression-Based Arguments + +Objects and primitive values, such as `Boolean`, `Date and time`, `Decimal`, `Enumeration`, `Integer/Long`, and `String`, can be passed and used in expressions. This method allows users to use functions and follow associations within the expression to set the argument values. Using expressions for arguments provides flexibility in setting values and improves the functionality of pages. In the example below, the page has a parameter **AnimalName** which is populated by an expression extracting the **Name** member of the provided **Animal** object: + +{{< figure src="/attachments/refguide/modeling/pages/page/page-parameter-expression.png" width="500px" >}} diff --git a/static/attachments/refguide/modeling/pages/page/page-parameter-argument-variable.png b/static/attachments/refguide/modeling/pages/page/page-parameter-argument-variable.png new file mode 100644 index 00000000000..6ecc403c215 Binary files /dev/null and b/static/attachments/refguide/modeling/pages/page/page-parameter-argument-variable.png differ diff --git a/static/attachments/refguide/modeling/pages/page/page-parameter-default-value.png b/static/attachments/refguide/modeling/pages/page/page-parameter-default-value.png new file mode 100644 index 00000000000..af67b27a8c3 Binary files /dev/null and b/static/attachments/refguide/modeling/pages/page/page-parameter-default-value.png differ diff --git a/static/attachments/refguide/modeling/pages/page/page-parameter-expression.png b/static/attachments/refguide/modeling/pages/page/page-parameter-expression.png new file mode 100644 index 00000000000..c229d1c7cb5 Binary files /dev/null and b/static/attachments/refguide/modeling/pages/page/page-parameter-expression.png differ diff --git a/static/attachments/refguide/modeling/pages/page/page-parameter-mappings.png b/static/attachments/refguide/modeling/pages/page/page-parameter-mappings.png new file mode 100644 index 00000000000..21b5cbf7c7a Binary files /dev/null and b/static/attachments/refguide/modeling/pages/page/page-parameter-mappings.png differ diff --git a/static/attachments/refguide/modeling/pages/page/page-parameter.png b/static/attachments/refguide/modeling/pages/page/page-parameter.png new file mode 100644 index 00000000000..ed1c3568bf8 Binary files /dev/null and b/static/attachments/refguide/modeling/pages/page/page-parameter.png differ