How to Check If a String is Empty in Power Automate?

Last week, I was working on a Power Automate flow where I needed to ensure that specific inputs were not empty before proceeding with the rest of the process. It’s common to run into situations where data might be missing or incomplete, and handling empty strings is essential to building reliable automation.

In this Power Automate tutorial, I will show you how to check if a string is empty in Power Automate with a simple scenario.

Check If a String is Empty in Power Automate

I will show you how to check if the string is empty in Power Automate with different examples.

Example – 1 [Check the Reason for Leave Column Null or Not]

Suppose you are creating a Power Automate flow to handle employee leave requests. The flow receives a form submission with several fields, including a “Reason for Leave” field. Before proceeding with the approval process, ensure the employee has provided a valid reason for their leave.

If the “Reason for Leave” field is empty, the flow should send an email asking the employee to provide the reason. If the field is filled in, the flow continues to the approval step.

For example, I already created a SharePoint list called Employee Leave Request:

power automate check if string is empty

Now follow the below steps to do this:

1. Create an automated cloud flow. Give the flow name and select the trigger When an item is created. Also, provide the Site Address and List Name.

power automate check empty string

2. Now, we will add the Condition action to check whether the Reason for Leave field is blank.

In this Condition action, select the Reason for Leave (from when an item is created action) value equal to null.

power automate if variable is empty

3. Then, Add the Send an email action inside the true section and provide the below parameters:

  • To: Employee’s email address.
  • Subject: Missing Reason for Leave.
  • Body: Provide an email body that replies with the Reason for Leave.
power automate if string is empty

Then, in the false section, you can add approval approval action.

Now click on Save and run the Flow manually. Once the flow runs, add an item to the SharePoint list, but do not add a Reason for Leave.

check if string is empty power automate

After the flow runs successfully, the employee gets an email about the Missing Reason for Leave.

power automate empty string

Example – 2 [Check Whether the Description is Empty or Not]

Imagine you’re managing tasks for a project in a team, and you’ve set up a flow that gets triggered when a new task is created. One of the fields in the task form is “Description,” and you want to ensure that the description is not left empty before the task is assigned. If the description is empty, you will remind the person creating the task to add a description.

For this example, I created a SharePoint list called Project Tasks:

power automate check if variable is empty

Now follow the below steps:

Create an automated cloud flow. Give the flow name and select the trigger When an item is created or modified. Also, provide the Site Address and List Name.

power automate check for empty string

Then, you can add a direct condition action to check or store the Description in a variable and then compare that variable using the condition action.

For this example, I store a variable using the Initialize variable action.

power automate condition if blank string

Then, add a condition action to check whether the variable has any value or not.

power automate condition if get items is empty

In the true section, add an action to email the task creator and ask them to add a description before assigning the task.

power automate set variable to empty string

If the condition is false (the task description is not empty), assign the task to the appropriate team member.

Now click on Save and run the Flow manually. Once the flow runs, add an item to the SharePoint list, but do not add a Description.

power automate if string null or empty

Then, you can see the task created, and the person will get an email.

How to Check If a String is Empty in Power Automate

If you need to check whether a field has any value, you can use the empty() function in Power Automate.

The empty() function evaluates whether a value (such as a string, array, or object) is empty.

  • If the value is null, undefined, or an empty string (""), it returns true.
  • If the value contains any data, it returns false.

If I use it to check whether the description is empty or not, in that case, the expression is like the one below:

empty(triggerBody()?['Description'])
power automate check if string is null or empty

The result returns true when the flow runs successfully because the Description field is blank.

power automate condition string

Conclusion

I hope you followed all the steps to understand this tutorial, which explored how to handle empty string values in Power Automate flows.

Related Power Automate articles:

>

Build a High-Performance Project Management Site in SharePoint Online

User registration Power Apps canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App

Power Platform Tutorial FREE PDF Download

FREE Power Platform Tutorial PDF

Download 135 Pages FREE PDF on Microsoft Power Platform Tutorial. Learn Now…