Skip to main content
Solved

Check if Item is in SharePoint Online Document Library

  • 9 July 2024
  • 1 reply
  • 25 views

 

How do I check if an item exists in a list?

  1. I upload a file in the event form and then get the file name from JSON
  2. The file name is stored as currentFileName
  3. Next I query the SharePoint Online list that I plan on uploading the file to. All records are returned from the query of the SPO list/document library.
  4. The query is stored as colSpo
  5. I check if an item exists, and it never returns true, but on my test, I have a file with a file name that I am trying to upload that is already in the list. Any idea why it evaluates to true?

Here is my process and my check if item exists in collection configuration:

 

 

 

 

 

1 reply

Userlevel 1
Badge +3

I solved the end result of what I was trying to do by counting the number of records that match the file name that I am attempting to upload. So, I get a 1 or a 0 and then it feeds into Branch by Condition. If it’s a 0 (no files with the same name), I let the file be uploaded, or a 1 (at least one file with the same name), the file is not allowed to be uploaded. 

Reply