Just wondering if someone could help me achieve this? I have a table with approx 5000 records that get generated, however I would like to only export the first 4000.
Any help would be much appreciated.
stratlake wrote:Just wondering if someone could help me achieve this? I have a table with approx 5000 records that get generated, however I would like to only export the first 4000. Any help would be much appreciated.
A short script will achieve what you want. There are several ways to approach it, but possibly as good as any would be:
There are some other options you might wish to add, such as choosing the export order, file type, name and path for the export (as attributes of the Export Records [ ] step), and you might consider having the script open a new window a the start and close it at the end, to avoid disturbing the user's found set and selected record - but the above should give you some ideas to get you started.
R J Cologon, Ph.D.
FileMaker Certified Developer
Author, FileMaker Pro 10 Bible
NightWing Enterprises, Melbourne, Australia
Show all records, sort them the way you prefer, go to record number 4001 and omit multiple records = Get (FoundCount) - 4000.
Worked perfectly - thank you very very much!
stratlake wrote:Worked perfectly - thank you very very much!
One small afterthought that you might want to consider... In the event that the script may ever be run at a time when there are less than 4,000 records in the table, an error will be returned when the Omit Multiple Records [ ] step tries to execute.
If that's a possible concern, you can code around it by adding an If[ ] and End If step, as follows:
With the additional steps, you'll get the same result if there are more than 4,000 records, but if there are less, the script will just export them all (so in effect it operates to limit the size of the export to 4,000).
It might not be an issue for you, but worth mentioning in case.
Retrieving data ...