The thing that you mentioned (creating a function to be used in profiles) is for creating Profiles.Pls have a look once more.

The one that you need is completly diffrent.