Formula Field Overview
Formula fields allow you to extend the simple AD lookup functions by using a C# script to manipulate the data and returning a string.
To create a new formula field, click on Admin> Fields on the left hand side menu>Click on the 'Create New' link.
Select Formula from the drop down options > select Continue
In the above example, we have created a field called 'MobileAndDescription'
Many of us are not sure whether our details such as Mobile Number, Fax Number, Landline Number etc. are up-to-date in the Windows Azure Active Directory (WAAD).
If we add a field, say (!mobile!) to our signature and the 'Mobile' field is empty in the WAAD, it will just leave a blank space in your signature configuration.
To over come that problem we have created this field. This field will search the WAAD for your Mobile Number. If it finds an entry it will populate the mobile number and put a label 'Mobile: ' in front of it.
If it finds the field empty, then it will return an empty string. So, your signature will not have empty spaces.
For details on using built in fields click here How do I configure lookups to add a description
, How do I add a newline to a formula lookup
It is important to provide a unique name to the field configuration as it will appear in the list of available fields while creating the signature or signature block configuration.
This is the place where you will write your C# script. The script will be executed at run time.
The formula is parsed in the same way as fields are in the body of the signature.
In the above example the (!mobile!) field will be calculated and the results will be inserted between the quotes to generate a string.
This text is then used in the formula to determine if the phone number and description should be inserted into the signature.
Your tenant already contains the above field, including similar fields for Fax and Phone Number.