Skip to content

Commit 72fd248

Browse files
committed
On branch edburns-msft-function-nits Apply suggestions from @tfitzmac
modified: articles/azure-resource-manager/managed-applications/create-uidefinition-functions.md
1 parent d7ad30e commit 72fd248

File tree

1 file changed

+39
-41
lines changed

1 file changed

+39
-41
lines changed

articles/azure-resource-manager/managed-applications/create-uidefinition-functions.md

Lines changed: 39 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -481,47 +481,45 @@ Assume `element1` and `element2` are undefined. The following example returns `"
481481
"[coalesce(steps('foo').element1, steps('foo').element2, 'foobar')]"
482482
```
483483

484-
> [!NOTE]
485-
> This function is especially in the context of optional invocation that happens due to user action after the page loads. For example, if the constraints placed on one field in the UI depend on the currently selected value of another, **initially non-visible** field. In this case, `coalesce()` can be used to allow the function to be syntactically valid at page load time, while having the desired effect when the user interacts with the field.
486-
>
487-
> Consider this `DropDown` which allows the user to choose from several different database types.
488-
>
489-
> ```
490-
> {
491-
> "name": "databaseType",
492-
> "type": "Microsoft.Common.DropDown",
493-
> "label": "Choose database type",
494-
> "toolTip": "Choose database type",
495-
> "defaultValue": "Oracle Database",
496-
> "visible": "[bool(steps('section_database').connectToDatabase)]"
497-
> "constraints": {
498-
> "allowedValues": [
499-
> {
500-
> "label": "Azure Database for PostgreSQL",
501-
> "value": "postgresql"
502-
> },
503-
> {
504-
> "label": "Oracle Database",
505-
> "value": "oracle"
506-
> },
507-
> {
508-
> "label": "Azure SQL",
509-
> "value": "sqlserver"
510-
> }
511-
> ],
512-
> "required": true
513-
> },
514-
> ```
515-
>
516-
> If we want to condition the action of another field on the current
517-
> chosen value of this field, we can use `coalesce()` to enable this
518-
> use case.
519-
>
520-
> ```
521-
> "regex": "[concat('^jdbc:', coalesce(steps('section_database').databaseConnectionInfo.databaseType, ''), '.*$')]",
522-
> ```
523-
>
524-
> This is necessary because the `databaseType` is initially not visible, and therefore does not have a value. This causes the entire expression to not evaluate correctly.
484+
This function is especially in the context of optional invocation that happens due to user action after the page loads. For example, if the constraints placed on one field in the UI depend on the currently selected value of another, **initially non-visible** field. In this case, `coalesce()` can be used to allow the function to be syntactically valid at page load time, while having the desired effect when the user interacts with the field.
485+
486+
Consider this `DropDown` which allows the user to choose from several different database types.
487+
488+
```
489+
{
490+
"name": "databaseType",
491+
"type": "Microsoft.Common.DropDown",
492+
"label": "Choose database type",
493+
"toolTip": "Choose database type",
494+
"defaultValue": "Oracle Database",
495+
"visible": "[bool(steps('section_database').connectToDatabase)]"
496+
"constraints": {
497+
"allowedValues": [
498+
{
499+
"label": "Azure Database for PostgreSQL",
500+
"value": "postgresql"
501+
},
502+
{
503+
"label": "Oracle Database",
504+
"value": "oracle"
505+
},
506+
{
507+
"label": "Azure SQL",
508+
"value": "sqlserver"
509+
}
510+
],
511+
"required": true
512+
},
513+
```
514+
515+
To condition the action of another field on the current chosen value of this field, use `coalesce()`, as shown here.
516+
517+
```
518+
"regex": "[concat('^jdbc:', coalesce(steps('section_database').databaseConnectionInfo.databaseType, ''), '.*$')]",
519+
```
520+
521+
This is necessary because the `databaseType` is initially not visible, and therefore does not have a value. This causes the entire expression to not evaluate correctly.
522+
525523

526524
## Conversion functions
527525
These functions can be used to convert values between JSON data types and encodings.

0 commit comments

Comments
 (0)