NEWS & TECH BLOG
User variables in GoldMine
29/05/2012 – in TechniquesGoldMine’s User Variables let you store all manner of user-specific information that may be merged into emails and documents. Some of these may be entered via a user’s preferences (Title, Phone, Fax, Department) but you can add any number of additional variables just by editing the user’s INI file (eg FRED.INI).
The INI file contains a lot of stuff divided into sections. Sections are marked by square brackets, and what we’re looking for is the user_var section.
It may or may not already exist, depending on whether you have set some of the user’s personal parameters in their preferences.
Each entry in the section is a user variable, and you can add as many as you like by hand. Here’s an example:
[user_var]
Title=GoldMine Guru
Dept=Administration
Branch=London
Quals=Bsc MSc
Title and Dept were put in from the user preferences, but I’ve added ‘branch’ and ‘quals’ by hand.
User_var names should only include letters or numbers; no spaces or symbols are allowed.
To use user variables in an email template just invoke them by <<&user_var.name>> (where ‘name’ is the name of your variable). So, from the above example, you’d put <<&user_var.branch>> to get the branch name to appear.
You can also put them into Word templates. The syntax is:
{ DDEAUTO GoldMine Data &user_var.branch *CHARFORMAT }
Luckily, in the latest version of the Word link, you don’t have to worry about this as there is a ‘User Variable’ button that shows you all of the available variables and allows you to simply select one and paste it in.
Earlier versions of the link weren’t as helpful. A useful tip is to just insert any field or variable (&userfullname is ideal), then highlight the inserted text, right-click and select ‘toggle field codes’. This will reveal the actual code, which will take the form of the example shown above. Just replace &userfullname with &user_var.name (eg user_var.branch), toggle the field codes again, and the job is done.
You can take this further by using a user_var to bring in (say) a specific logo that depends on that branch.
First of all, create a set of Word documents that contain the dynamic content. In this example it will be a set of documents that each contain one branch logo.
For our example, let’s assume that we’ve created an insert called ‘midlands footer.doc’ and that it’s stored at w:goldminetemplateheaders and footersmidlands footer.doc.
You’d then use the following syntax in the main template:
{ INCLUDETEXT “w:\goldmine\template\headers and footers\{ DDEAUTO GoldMine Data &user_var.branch * MERGEFORMAT ) footer.doc” * MERGEFORMAT }
Note the use of double backslashes in the path.
You can see how you could use this technique to bring in individual scanned signatures, most efficiently by using the existing &UserName macro instead of a user_var. So, we’d set up inserts called fred.doc, master.doc etc that mirror your GoldMine user names and put &UserName into the above syntax.