what is the best way to count the lines in an CSV file, so that if the lines are greater then 1000 it will skip the record creation and then post the whole file into SFTP. if less than 1000 then it will create the record.
If you can fit all the data on a single page, you could set your export page size to 1001. Then, within the pre-save page script, you could check whether data.length > 1000, and if so, call the Job API of the current flow to cancel it.