Power Automate is a cloud-based service that allows users to create automated workflows between various applications and services. One common scenario in which Power Automate is used is to check if a field is null or empty in a particular data source, such as a SharePoint list or Excel spreadsheet.
This allows users to create more efficient and effective workflows, as they can avoid errors and incomplete data by ensuring that required fields are filled out before proceeding with the workflow. In this process, Power Automate uses conditions and actions to evaluate the data and execute the workflow based on the results.
In this post, we will learn how to use If condition in Power Automate Check if field is null or empty.
Power Automate Check if field is null or empty
Power Automate’s If Condition is a logical function that allows users to specify a condition for executing a specific action based on specific criteria. In this section, we will explore how to use the If Condition to check if a field in a SharePoint list is empty or null when an item is being updated.
Assuming that you have a SharePoint List called “Issue Tracker” that includes the columns mentioned below:
In this scenario, there is a field named “Date Reported” that is currently empty. To address this, it may be necessary to check whether the user has set a reported date when updating the item. If no reported date has been set, the flow can be configured to automatically set the “Date Reported” field to the current modified date.
There are two possible ways to achieve your objective in this situation:
- Using Calculated Column to check if field is blank, set the field to the modified date field.
- Or Using Power Automate Check if field is null or empty.
As previously mentioned, the main focus of this post is on the second method of using Power Automate to check if a field is null or empty.
How to Check if field is null Power Automate
To use Power Automate Check if field is null or empty, you have to follow the below steps:
- Open your SharePoint List, and from the above toolbar, click on “Integrate” > “Power Automate” > “Create a flow“.
- The suggested flow templates will be opened, click on “See More“, then select “When an existing SharePoint list item is modified, complete a custom action” template.
- The Power Automate portal will be opened, and if you are not sign in, provide your credentials to create your flow.
- Now, review the flow connectors, and if everything is OK, click on “Continue” to proceed.
- The flow studio will be opened to build your flow, search for “Control“
- And from “Control“, click on “Condition” to add If Condition in Power Automate.
- Great the If condition has been added, now click on the first textbox , and from “Dynamic Content“, select the field the you need to check if its value is null or empty as stated below.
- Now click at the second textbox, select “Expression“, and type “Null“, then press “OK“.
- The final condition should looks like below
- At “If Yes” section, click on “Add an Action“.
- Search for “Update Item“.
- Set the Site Address to the same site that contains your list.
- Set the List Name yo your list.
- Set the ID to the List Item ID as stated below.
- Repeat the above steps with the Title and any other required field.
- Now, at Reported Date field, set it to the created or Modified Date as per your needs.
- Save your flow.
- Check for errors using Flow Checker.
- Great, there is no errors.
- Now, click on “Test” to test your flow.
- If it’s the first time that you test your flow, you will note that only manually option is available, so click on test to start the flow test.
- Go back to your list to edit an list item, then click on “Save“.
- Great, the flow is run and the blank field has been updated successfully as shown below.
In conclusion, checking if a field in SharePoint List is empty using Power Automate can be a simple and effective way to automate processes and workflows.
By following the steps outlined in this post, users can create a flow that automatically checks if a specific field in a SharePoint List is empty and triggers specific actions based on the result. This can save time and improve efficiency by eliminating the need for manual checks and interventions.