I'm implementing my invoice parser app. I have service which I've written in python,it parses invoice PDF that comes from LWC file uploader and returns JSON which apex parses and stores extracted fields from there as Opportunity objects. As all files in SF stored in Files Home, I need to query them (service does the query). Now my query gets only one file
querySOQL = """
SELECT ContentDocumentId, Title, FileExtension, VersionData
FROM ContentVersion
WHERE FileExtension LIKE '%pdf%' AND IsLatest=True
ORDER BY CreatedDate DESC LIMIT 1
"""
But I want my service to parse as many files as user uploaded. What I am trying to do is
SELECT ContentDocumentId, Title, FileExtension, VersionData, CreatedDate
FROM ContentVersion
WHERE CreatedDate = TODAY AND
FileExtension LIKE '%pdf%'
AND IsLatest=TRUE ORDER BY CreatedDate DESC
It gets all files that were uploaded during the current day but how to query all files uploaded in past several minutes range? If you have any ideas help me please. Thank you in advance.