Skip to main content

 

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:

 

 

 

 

 

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