Using empty() Expression


When working with Power Automate, you often need to check whether a value exists before performing an action. One common scenario is verifying if a field in dynamic content is empty. In this post, we’ll break down the empty() expression and how to use it to check if an email message has a replyToId.

empty(outputs('Get_message_details')?['body/replyToId'])

Breaking It Down:

1. outputs(‘Get_message_details’)

• This retrieves the output of the “Get message details” action.

2. ?[‘body/replyToId’]

• The ? (question mark) is a safe navigation operator, meaning if replyToId doesn’t exist, it won’t cause an error—it will simply return null.

3. empty(…)

• The empty() function checks if the provided value is null, an empty string, or an empty array.

• If replyToId is missing or contains an empty value, empty() returns true. Otherwise, it returns false.