Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm working with some sensitive data where the primary key is shared between 4 different tables. This primary key is a personal identifier number that needs to be hidden from the users, but still needs to be used for some calculations and as the key to maintain table links.
What is the best way to use this field in the backend as a key and for calculations, but hide it from users so they can't see the actual identification number? I tried using the HidePrefix in the script, but it's still possible for users to view it if they enable system fields. Would it be best to scramble the field, or is there another preferred method?
You can use the Autonumber functions. You will get a different number for every value, not similar to the original values, thus hidding them to the users.
Thanks. I understand how to use the autonumber for one table, but how do I do it with 4 tables and so that it maintains the primary key?
If I were to use the Autonumber function and one table is missing a record, wouldn't it throw off the link?
You may use AutoNumber(Expression, AutoID)
tag yourfileld $hidden
You can use autonumber across all the tables and you will get consistent translation. For the same input key value, you will get the same return from autonumber(). It doesn't matter if one table is missing some values.
-Rob
If you use Autonumber() during the same script execution it should work ok. This is because Autonumber() will give a different/unique number for each different value and not depends on the number or order of the records