Skip to content

Commit 6987da4

Browse files
Merge pull request #306518 from ecfan/question-operator
[Azure Logic Apps] Add more info about the ? operator
2 parents 1cef304 + c8e5db9 commit 6987da4

2 files changed

Lines changed: 15 additions & 15 deletions

File tree

articles/logic-apps/expression-functions-reference.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ title: Reference for functions in workflow expressions
33
description: Learn about expression functions for workflows in Azure Logic Apps and Power Automate.
44
services: logic-apps
55
ms.suite: integration
6-
ms.reviewer: estfan, niding, azla
6+
ms.reviewers: estfan, niding, azla
77
ms.topic: reference
8-
ms.date: 07/08/2025
8+
ms.date: 10/06/2025
99
---
1010

1111
# Reference guide to functions in expressions for workflows in Azure Logic Apps and Power Automate
@@ -145,6 +145,7 @@ To work with collections, generally arrays, strings, and sometimes, dictionaries
145145
To work with conditions, compare values and expression results, or evaluate various kinds of logic, you can use these logical comparison functions. For the full reference about each function, see the [alphabetical list](../logic-apps/workflow-definition-language-functions-reference.md#alphabetical-list).
146146

147147
> [!NOTE]
148+
>
148149
> If you use logical functions or conditions to compare values, null values are converted to empty string (`""`) values. The behavior of conditions differs when you compare with an empty string instead of a null value. For more information, see the [string() function](#string).
149150
150151
| Logical comparison function | Task |

articles/logic-apps/workflow-definition-language-schema.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,20 @@ title: Workflow Definition Language schema reference
33
description: Reference guide to the JSON schema and syntax for the Workflow Definition Language that describes workflows in Azure Logic Apps.
44
services: logic-apps
55
ms.suite: integration
6-
ms.reviewer: estfan, azla
6+
ms.reviewers: estfan, azla
77
ms.topic: reference
8-
ms.date: 07/18/2025
8+
ms.date: 10/06/2025
99
---
1010

1111
# Schema reference guide for the Workflow Definition Language in Azure Logic Apps
1212

13-
When you create a logic app in [Azure Logic Apps](../logic-apps/logic-apps-overview.md), your logic app has an underlying workflow definition that
14-
describes the actual logic that runs in your logic app. That workflow definition uses [JSON](https://www.json.org/) and follows a structure that's validated by the Workflow Definition Language schema. This reference provides an overview about this structure and how the schema defines attributes in your workflow definition.
13+
When you create a logic app workflow in [Azure Logic Apps](../logic-apps/logic-apps-overview.md), the workflow has an underlying JavaScript Object Notation (JSON) definition that describes the actual logic that runs the workflow. The workflow definition follows a structure that is validated against the Workflow Definition Language schema. This reference provides an overview about this structure and how the schema defines attributes in your workflow definition.
1514

1615
## Workflow definition structure
1716

18-
A workflow definition always includes a trigger for instantiating your logic app, plus one or more actions that run after the trigger fires.
17+
A workflow definition always includes a trigger that instantiates the workflow, plus one or more actions that run after the trigger fires.
1918

20-
Here is the high-level structure for a workflow definition:
19+
Here's the high-level structure for a workflow definition:
2120

2221
```json
2322
"definition": {
@@ -52,9 +51,9 @@ In a workflow definition, the `triggers` and `actions` sections define the calls
5251

5352
## Parameters
5453

55-
The deployment lifecycle usually has different environments for development, test, staging, and production. When deploying logic apps to various environments, you likely want to use different values, such as connection strings, based on your deployment needs. Or, you might have values that you want to reuse throughout your logic app without hardcoding or that change often. In your workflow definition's `parameters` section, you can define or edit parameters for the values that your logic app uses at runtime. You must define these parameters first before you can reference these parameters elsewhere in your workflow definition.
54+
The deployment lifecycle usually has different environments for development, test, staging, and production. When deploying logic apps to various environments, you likely want to use different values, such as connection strings, based on your deployment needs. Or, you might have values that you want to reuse throughout your workflow without hardcoding or that change often. In your workflow definition's `parameters` section, you can define or edit parameters for the values that your workflow uses at runtime. You must define these parameters first before you can reference these parameters elsewhere in your workflow definition.
5655

57-
Here is the general structure for a parameter definition:
56+
Here's the general structure for a parameter definition:
5857

5958
```json
6059
"parameters": {
@@ -73,11 +72,11 @@ Here is the general structure for a parameter definition:
7372
|-----------|----------|------|-------------|
7473
| <*parameter-name*> | Yes | String | The name for the parameter that you want to define |
7574
| <*parameter-type*> | Yes | int, float, string, bool, array, object, securestring, secureobject <br><br><br><br>**Note**: For all passwords, keys, and secrets, use the `securestring` or `secureobject` types because the `GET` operation doesn't return these types. For more information about securing parameters, see [Security recommendations for action and input parameters](logic-apps-securing-a-logic-app.md#secure-action-parameters). | The type for the parameter |
76-
| <*default-parameter-value*> | Yes | Same as `type` | The default parameter value to use if no value is specified when the workflow instantiates. The `defaultValue` attribute is required so that the Logic App Designer can correctly show the parameter, but you can specify an empty value. |
75+
| <*default-parameter-value*> | Yes | Same as `type` | The default parameter value to use if no value is specified when the workflow instantiates. The `defaultValue` attribute is required so that the workflow designer can correctly show the parameter, but you can specify an empty value. |
7776
| <*array-with-permitted-parameter-values*> | No | Array | An array with values that the parameter can accept |
7877
| <*parameter-description*> | No | JSON object | Any other parameter details, such as a description for the parameter |
7978

80-
Next, create an [Azure Resource Manager template](../azure-resource-manager/templates/overview.md) for your workflow definition, define template parameters that accept the values you want at deployment, replace hardcoded values with references to template or workflow definition parameters as appropriate, and store the values to use at deployment in a separate [parameter file](../azure-resource-manager/templates/parameter-files.md). That way, you can change those values more easily through the parameter file without having to update and redeploy your logic app. For information that is sensitive or must be secured, such as usernames, passwords, and secrets, you can store those values in Azure Key Vault and have your parameter file retrieve those values from your key vault. For more information and examples about defining parameters at the template and workflow definition levels, see [Overview: Automate deployment for logic apps with Azure Resource Manager templates](logic-apps-azure-resource-manager-templates-overview.md).
79+
Next, create an [Azure Resource Manager template](../azure-resource-manager/templates/overview.md) for your workflow definition, define template parameters that accept the values you want at deployment, replace hardcoded values with references to template or workflow definition parameters as appropriate, and store the values to use at deployment in a separate [parameter file](../azure-resource-manager/templates/parameter-files.md). That way, you can change those values more easily through the parameter file without having to update and redeploy your logic app. For information that's sensitive or must be secured, such as usernames, passwords, and secrets, you can store those values in Azure Key Vault and have your parameter file retrieve those values from your key vault. For more information and examples about defining parameters at the template and workflow definition levels, see [Overview: Automate deployment for logic apps with Azure Resource Manager templates](logic-apps-azure-resource-manager-templates-overview.md).
8180

8281
<a name="static-results"></a>
8382

@@ -258,7 +257,7 @@ In the `outputs` section, define the data that your workflow can return when fin
258257
> When responding to incoming requests from a service's REST API, don't use `outputs`. Instead, use the `Response` action type.
259258
> For more information, see [Workflow triggers and actions](../logic-apps/logic-apps-workflow-actions-triggers.md).
260259
261-
Here is the general structure for an output definition:
260+
Here's the general structure for an output definition:
262261

263262
```json
264263
"outputs": {
@@ -285,10 +284,10 @@ In [expressions](#expressions) and [functions](#functions), operators perform sp
285284

286285
| Operator | Task |
287286
|----------|------|
288-
| `'` | To use a string literal as input or in expressions and functions, wrap the string only with single quotation marks, for example, `'<myString>'`. Do not use double quotation marks (`""`), which conflict with the JSON formatting around an entire expression. For example: <br><br>**Yes**: length('Hello') </br>**No**: length("Hello") <br><br>When you pass arrays or numbers, you don't need wrapping punctuation. For example: <br><br>**Yes**: length([1, 2, 3]) </br>**No**: length("[1, 2, 3]") |
287+
| `'` | To use a string literal as input or in expressions and functions, wrap the string only with single quotation marks, for example, `'<myString>'`. Don't use double quotation marks (`""`), which conflict with the JSON formatting around an entire expression. For example: <br><br>**Yes**: length('Hello') </br>**No**: length("Hello") <br><br>When you pass arrays or numbers, you don't need wrapping punctuation. For example: <br><br>**Yes**: length([1, 2, 3]) </br>**No**: length("[1, 2, 3]") |
289288
| `[]` | To reference a value at a specific position (index) in an array or inside a JSON object, use square brackets, for example: <br><br>- To get the second item in an array: <br><br>`myArray[1]` <br><br>- To access the properties inside a JSON object: <br><br>*Example 1*: <br>`setProperty(<object>, '<parent-property>', addProperty(<object>['<parent-property>'], '<child-property>', <value>)` <br><br>*Example 2*: <br>`lastIndexOf(triggerBody()?['subject'],'some string')` |
290289
| `.` | To reference a property in an object, use the dot operator. For example, to get the `name` property for a `customer` JSON object: <br><br>`"parameters('customer').name"` |
291-
| `?` | To reference null properties in an object without a runtime error, use the null-ignore (**?**) operator. For example, to handle null outputs from a trigger, you can use the following expression: <br><br>`coalesce(trigger().outputs?.body?['<someProperty>'], '<property-default-value>')` |
290+
| `?` | To reference an object's property without risking a runtime error or the workflow failing, use the question mark operator (`?`), also known as the *null ignore operator*, preceding the property. This operator lets you safely access a property or array element when the parent object or referenced property might contain `null` or is missing. <br><br>- If the parent object that appears before the `?` operator is `null` or is missing the referenced property, the entire expression returns `null`, rather than the workflow failing. <br><br>- If the object or property exists, the expression returns the property's value. <br><br>For example, suppose you have the following expression: <br><br>`triggerBody()?['ContentData']` <br><br>- If `triggerBody()` returns an object from the `ContentData` property, you get the object's value. <br><br>- If `triggerBody()` is `null` or is missing the `ContentData` property, the function returns `null` rather than fail with the error **"Unable to process template language expressions"**. <br><br>The `?` operator also lets you safely chain access properties and is useful in the following scenarios: <br><br>- Manage expressions that work with optional JSON fields. <br>- Handle connector outputs that might omit certain properties. <br>- Avoid brittle expressions in conditional logic. <br><br>For example, to chain property access and handle null outputs from a trigger, you can use the following expression: <br><br>`coalesce(trigger().outputs?.body?['<property-name>'], '<property-default-value>')` |
292291

293292
<a name="functions"></a>
294293

0 commit comments

Comments
 (0)