Pragmatic Works Nerd News

Power Automate: Working with Nulls and Empty Lists in SharePoint

Written by Jonathon Silva | Nov 05, 2026

Working with null values in SharePoint can be one of the more frustrating parts of building reliable Power Automate flows. In this Pragmatic Works training recap, Jonathon Silva walks through a practical example that helps users understand how to detect blank values in a SharePoint list and use that logic to control how a flow behaves.


Using an employee timecard scenario, Jonathon demonstrates how Power Automate can check whether a user forgot to clock out the previous day before allowing a new clock-in entry. He also shows how to handle an additional edge case where the SharePoint list is completely empty. The result is a smarter, more reliable flow that responds correctly in both situations.

The Business Scenario

Jonathon uses a simple SharePoint list called an employee timecard card list. The list contains only a few columns:

  • Employee name
  • Clock in time
  • Clock out time

The purpose of the list is to track when an employee starts and ends work. A basic flow already exists to create a new clock-in record using a manual trigger. That setup works well for adding new entries, but it creates a problem when an employee forgets to clock out from the previous shift.

If a user clicks the clock-in button again without first closing out the previous entry, the system could create another incomplete record. Jonathon explains that this is where null checking becomes important.

Why Null Values Matter in Power Automate

Null values appear when a field in SharePoint has no data. In this example, a blank clock out time means the employee never finished the previous timecard card record. Jonathon shows that instead of blindly creating a new item, the flow should first verify whether the latest record is complete.

If the clock out value is null, the flow should stop the new clock-in action and notify the user. If the clock out value contains data, the flow can safely create a new item.

How the Flow Checks the Previous Entry

To solve this, Jonathon adds a Get Items action in Power Automate. This action retrieves records from the SharePoint list and allows the flow to inspect the most recent entry for the current user.

He configures the action with several important settings:

  1. Use a filter query to return only records for the current user.
  2. Sort the results by ID in descending order so the newest item appears first.
  3. Limit the returned results to one item so only the most recent entry is checked.

This setup ensures the flow is checking the right employee and the correct record before moving forward.

Using a Condition to Detect Null

Once the latest item is returned, Jonathon adds a condition that checks the Clock Out Time field. Because the Get Items action returns an array, Power Automate automatically wraps the logic in an Apply to Each loop.

The condition checks whether the clock out value is equal to null.

  • If the result is true, the flow sends an email reminder telling the user they forgot to clock out.
  • If the result is false, the flow creates a new clock-in record.

Jonathon tests both outcomes to confirm the logic works correctly. First, the flow detects a blank clock out field and sends an email. Then, after adding a clock out time to the SharePoint record, he runs the flow again and confirms that a new item is created as expected.

Handling the Empty List Edge Case

Jonathon then highlights an important issue many beginners overlook. What happens if the SharePoint list is empty?

In that case, the Get Items action returns nothing. Since there are no records to loop through, the condition that checks the clock out value never runs. That means the flow does nothing, which is not the desired behavior.

To fix this, he adds a second condition before the null check. This new condition uses the length expression to test whether the SharePoint list contains any returned items.

The logic works like this:

  1. Check the length of the returned value array.
  2. If the length is greater than zero, continue with the original null-check process.
  3. If the length is not greater than zero, create the very first clock-in item immediately.

This extra step makes the flow much more dependable because it now works whether the list already contains records or is starting from scratch.

Key Takeaways from Jonathon Silva

  • Use Get Items to retrieve SharePoint records before making decisions in a flow.
  • Filter by user so the flow only checks relevant records.
  • Sort descending and return one item to inspect the most recent entry.
  • Use a condition with null to detect blank fields.
  • Use the length expression to handle cases where no records exist at all.

Final Thoughts

Jonathon Silva provides a practical and easy-to-follow lesson on managing null values in SharePoint with Power Automate. Rather than focusing only on theory, he walks through a real-world business example that demonstrates why null handling is essential for flow reliability. By combining a filtered Get Items action, a null condition, and a length check, users can build smarter automations that prevent bad data and improve process accuracy.

For anyone learning how to connect SharePoint and Power Automate more effectively, this is a strong example of how a few carefully placed checks can make a flow far more robust.

 Don't forget to check out the Pragmatic Works' on-demand learning platform for more insightful content and training sessions on Power Automate and other Microsoft applications. Be sure to subscribe to the Pragmatic Works YouTube channel to stay up-to-date on the latest tips and tricks.