Using hashes for validation
Earlier in the year I released a video about using Google Forms in order to capture and then import data into FileMaker Pro. The code I was personally using was a bit more advanced than what I wanted to show at that time, so I simplified the process.
Having implemented, and used, many more Google Forms since that time, and knowing that I was exercising a great degree of control over the import process, I decided to reveal it all.
So, in this video I showcase the method I use to verify that an import is exactly what you expect it to be. I use an MD5 hash, which FileMaker implemented in version 13 under the somewhat hidden feature of GetContainerAttribute(). Using an MD5 hash it’s possible to uniquely identify anything you could ever want to identify. It’s a fast hashing algorithm and it can be used for all kinds of features within your FileMaker database. You can determine if a collection of fields has been changed. Whether an image has been modified or, in this case, whether an import file meets your exact criteria.
If you deal with imports and you like knowing that a file will match the expectations of your scripts then this video will provide a wealth of information regarding that process!
Comments
import with matching names
nice technique to import using 'matching names'.
The major drawback with exporting to .mer is that you cannot select utf-8 encoding and that can sometimes be limiting.
I recently had the case of an export/import between filemaker files, text (.csv or .mer) was the solution because of its speed, but since utf-8 was required, I had to use .csv and loose 'matching names'.
BTW, with Fabrice we recently came up with a way to also use 'matching names' when importing from ODBC :
http://www.1-more-thing.com/odbc-import-technique/
$validFileHeaders not working when multiple are present
This is just what I needed! Thanks for all the great trainings.
During implementation our columns changed. I added the new hash to $validFileHeaders. The IF statement on line 5 fails so I updated it to IF ( $hashIdentifier = FilterValues ( $validFileHeaders ; $hashIdentifier ) ) which still fails. I double checked the hash and they are correct and should evaluate correctly. Any ideas?
Got it!
Evaluate ( $hashIdentifier ) = Evaluate ( $validFileHeaders )