Skip to main content

How to Check Whether a SharePoint List Exists in Power Automate

· 5 min read
Jagdish Kumawat
Founder @ Dewiride

A flow that creates a SharePoint list should check first whether it's already there. Then running it twice changes nothing, and a half-finished run can simply be run again. This guide checks for a list with one REST request and a condition.

Prerequisites​

Step 1: Ask for the List by Title​

Add a Send an HTTP request to SharePoint action called Find the list:

FieldValue
Site AddressThe site, here the trigger's Site URL
MethodGET
Uri_api/web/lists?$filter=Title eq ' + the title + '&$select=Id
HeadersAccept: application/json;odata=nometadata

Type the Uri's text and insert the title as an expression in the middle (How to Add an Expression):

The Find the list pane with Site Address set to the Site URL token, Method GET, the Uri _api/web/lists?$filter=Title eq ' followed by an items(...) expression token and '&$select=Id, and the Accept header

In Code view, the Uri reads:

Uri
_api/web/lists?$filter=Title eq '@{items('For_each_list')?['title']}'&$select=Id

$filter=Title eq '...' keeps only the lists with that title, and $select=Id returns only their IDs, which keeps the response small. The request succeeds either way: SharePoint returns the matching lists in an array called value, which is empty when there's no such list.

Step 2: Test the Result​

Add a Condition called If the list is missing (How to Add a Condition). Compare this expression with the expression true:

Expression
empty(body('Find_the_list')?['value'])

The If the list is missing condition with empty(...) is equal to true, and its True and False branches inside For each list on the canvas

How to Check Whether an Array Is Empty explains empty().

Step 3: Act Only When It's Missing​

Put the step that creates the list in the True branch (How to Create a SharePoint List with the REST API), and leave False empty. Steps after the condition then work on the list whether it was just created or already there.

Check It in Runs​

The runs I made while building the flow created both lists on an empty test site. Every later run found them, so Create the list was skipped:

A repeat run with Find the list succeeded, If the list is missing succeeded, and Create the list in the True branch skipped

The Same Check for a Column​

Columns work the same way, with the list's fields and the column's internal name. Find the column in the setup flow uses:

Uri
_api/web/lists/getbytitle('@{items('For_each_list')?['title']}')/fields?$filter=InternalName eq '@{items('For_each_column')?['name']}'&$select=InternalName

and If the column is missing tests empty(body('Find_the_column')?['value']) in the same way (How to Add a Column with CreateFieldAsXml).

Common Mistakes​

MistakeWhat happensDo this instead
Creating without checkingA second run tries to create the list againCheck first
Forgetting the quotes around the titleThe filter is invalidKeep '...' around the expression
Testing the whole bodyIt's never emptyTest ?['value']

Troubleshooting​

SymptomLikely causeFix
The list is created twiceThe condition compares with the text trueAdd true as an expression
Find the list failsThe site address is wrongCheck Site URL
Nothing is found, but the list existsThe title differs, such as by a spaceUse the exact title from Site contents

FAQ​

Why filter by title instead of asking for the list directly?​

A filter query answers with an array, empty or not, which a condition can test. That keeps the check a normal, successful step.

Is the title match case-sensitive?​

My checks always used the exact titles, so I can't say. Use the title exactly as SharePoint shows it.

Conclusion​

Ask SharePoint for _api/web/lists?$filter=Title eq '<title>'&$select=Id, test empty(body(...)?['value']) in a condition, and create the list only in the True branch. The flow can then run as often as you need.

Additional Resources​

Stay Updated

Subscribe to our newsletter for the latest tutorials, tech insights, and developer news.

By subscribing, you agree to our privacy policy. Unsubscribe at any time.