How to Check if an item exists in a SharePoint list using Power Automate?

Do you need to check if an item exists in the SharePoint list using Power Automate? This tutorial is for you. Here I have explained how to check if an item exists in a SharePoint list or not using Power Automate. If you follow the below steps, I’m sure you will meet the need.

Scenario:

The flow triggers manually and requests users to enter the input values, and it checks whether the entered values are presented in the SharePoint list item or not. If the item is not presented it creates a new item with the user-requested values else it displays an item that already exists in the compose data operation.

Follow the below steps, to achieve this:

Check if an item exists in a SharePoint list using Power Automate

Let us see how to check if an item exists in the SharePoint list using the Power Automate flow

In this example, I am going to use the Employee SharePoint list consisting of,

  • EmployeeID – default title column
  • EmployeeName – Text type
  • EmployeeDesignation- Text type
  • DateofJoining- Date and Time type
  • EmployeeStatus- Choice type
  • ContactNumber- Number type
  • EmployeeEmailAddress- Text type
Check if an item exists in a SharePoint list using Power Automate

Step-1:

  • Login to Power Automate using Microsoft credentials, Select the +create, and choose instant cloud flow.
  • Enter the flow name and click on the create option.
How to check if an item exists in the Sharepoint list using Power Automate flow

Step-2:

Expand the Manual trigger action and add the inputs for the below fields,

  • EmployeeID – Text type
  • EmployeeName – Text type
  • EmployeeDesignation- Text type
  • EmployeeEmailAddress- Email
  • DateofJoining- Date and Time type
  • ContactNumber- Number type
check if an item exists in the Sharepoint list using Power Automate flow

Step-3:

  • Add +new step, select get items action from action triggers, and configure the SharePoint site address and List name.
  • In the Filter query field add conditions for unique columns: Here I have taken EmployeeID, EmployeeEmailAddress, and ContactNumber fields.
  • If any of these fields contains the user-requested value it will not create a new item in the SharePoint list. Instead, it displays items with the same information that exists already in the SharePoint list.
"Title eq '@{triggerBody()['text']}' or EmployeeEmailAddress eq '@{triggerBody()['email']}' or ContactNumber eq '@{triggerBody()['number']}'"

Where,

  • Title, EmployeeEmailAddress, and ContactNumber = Column internal names
  • triggerBody()[‘text’], triggerBody()[’email’] and triggerBody()[‘number’] = User Inputs
check if an item exists in the Sharepoint list using Power Automate

Step-4:

See also  How to Remove line breaks from text in Power Automate?

Add a condition control and check if the item exists in the SharePoint list or not by using the below formula.

length(outputs('Get_items')?['body/value'])
  • If yes, select the create item action from the action trigger and configure the SharePoint site address and list name.
  • Add dynamic content values for all the fields as shown below:
  • If no, add a compose data operation and pass the input value as the item already exists in the SharePoint list.
Example to check if an item exists in the Sharepoint list using Power Automate flow

Step-5:

Save and Enter the details and run the flow by selecting the run flow option.

Case-1:

Here I am going to pass the same email address (highlighted in red) that already exists in the SharePoint list item.

Example to check if an item exists in the Sharepoint list using Power Automate

Enter the details and click the run flow option.

Example to check if an item exists in the Sharepoint Online list using Power Automate

Once the flow runs successfully, we can see that it doesn’t create new items because an item with requested input already exists in the SharePoint list.

Example to check if an item exists in the Sharepoint Online list using Power Automate flow

Case-2:

Here I am going to enter the values that are not presented in the SharePoint list item. Click the run flow option.

How to check if an item exists in the Sharepoint online list using Power Automate

Once the flow runs successfully, we can see that it creates a new item in the SharePoint list.

How to check if an item exists in the Sharepoint online list using Power Automate flow

Refresh the SharePoint list, you can see the new item has been added with the user-requested inputs.

power automate check if an item exists in the Sharepoint list

This is how to check if an item exists in the Sharepoint list using Power Automate flow.

Conclusion

In this Power Automate tutorial, I have explained how to check whether an item exists in the SharePoint list or not using Microsoft Flow or Power Automate.

You may also like:

  • hello, if i want yo make this but the trigger is when an item is created on a list/file library, what changes do i have to make? i tried to do the exact steps changing the trigger but nothing happens

  • >