How to Check if a field exists in SharePoint Using Power Automate?

While working on Power Automate, one of my clients needed a solution to check if a specific column exists in a SharePoint list. This was important because the workflow required handling different actions depending on whether the column was present.

In this tutorial, I will show you how to check if a field exists in SharePoint using Power Automate. You can also use the same flow to check if a field exists in a SharePoint library.

Check if a field exists in SharePoint Using Power Automate

Suppose you are working with a SharePoint list named Employee Records. This list is used to manage employee details. It currently contains the following columns:

  1. Employee ID (Single line of text)
  2. Employee Name (Single line of text)
  3. Department (Choice)
power automate check if field exists

I need to build a Power Automate flow that checks if a “Joining Date” column exists in this list. If the column exists, send an email. If it doesn’t, the flow should send an email.

Now follow the below steps:

1. In the Power Automate, click the Instant Cloud flow, enter the Flow name, and choose the trigger flow (i.e., manually trigger a flow). Then, expand the trigger and add a Text input to allow users to enter the field name they want to check.

Check If a field exists in SharePoint List Using Power Automate

2. Then add a Send an HTTP request to SharePoint action from sharePoint Connector with the below parameter:

  • Site Address: Select the SharePoint Site Address
  • Method: Select “Get” as the method
  • URI: Provide the below URI:
_api/web/lists/getbytitle(‘List Name’)/Fields

Change the List Name to match your list names.

  • Header: Use the below headers to make REST API calls to SharePoint:
accept: application/json;odata=verbose
content-type: application/json;odata=verbose
power automate check if file exists

3. Add the Filter array action. For the From field, use the below expression to reference the list of fields:

body('Send_an_HTTP_request_to_SharePoint')['d']['results']

Add a condition in the Filter array:

  • Left-hand side: Use the expression:
item()['InternalName']
  • Right-hand side: Use the text input from the dynamic content manual trigger:
triggerBody()['text']
Check If a field exists in SharePoint List in Power Automate

This action filters the fields to check if the user-provided field name matches any InternalName in the SharePoint list.

5. Add a Compose action to calculate the length of the filtered array. Then use the below expression in the Compose action:

length(body('Filter_array'))
Power Automate Check If a field exists in SharePoint List

If the result is 0, it means the field does not exist. If the result is greater than 0, the field exists.

6. Add a Condition action to check the result of the Compose action:

outputs('Compose') is less or equal to  0
How to Check If a field exists in SharePoint List in Power Automate

7. In the True section, add the Send an email action and provide below parameters:

  • Email: Provide the user’s email.
  • Subject: Provide like “Field Not Found in SharePoint List.”
  • Body: Provide like “The requested field does not exist in the employee list.”
Check if the field exists or not using Power Automate

8. In the False section, add the Send an email action and provide below parameters:

  • Email: Provide the user’s email.
  • Subject: Provide like “Field Found in SharePoint List.”
  • Body: Provide like “The requested field already exists in the EmployeeList.”
Power Automate Check if the field exists or not

Run the Flow to Check if a Field Exists in the SharePoint List

Save and test the flow manually, then enter the field name (Internal Name) you want to check in the text input field.

How to Check If a field exists in SharePoint List Using Power Automate

After it runs successfully, check your email inbox to confirm whether you have received the email about whether the field exists.

How to Check If a field exists using SharePoint List Using Power Automate

Conclusion

In this tutorial, I covered how to create a Power Automate flow to check if a specific column exists in a SharePoint list. You can also use the same flow to check if a field exists in a SharePoint library.

Related Power Automate tutorials:

>

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…