How to Create Custom Lookup Fields

Note: Custom Lookup Fields are available for on-premise deployments only. 

AirWatch uses standard lookup values to dynamically generate a variety of content that is specific to each end user. These are often used in email profiles, for instance, so that each end user receives a profile with content specific to their account. Below is a list of the standard lookup values that can be used to dynamically generate content based on available user data. 

{EmailDomain}                          {EmailUserName}                      {EmailAddress}                                    {EnrollmentUser}        {EnrollmentUserId}
{DeviceUid}                                 {DynamicScepChallenge}        {GroupIdentifer}                                    {SessionToken}           {DeviceFriendlyName}
{DeviceSerialNumber}              {UserPrincipalName}                {DeviceSerialNumberLastFour}        {DevicePlatform}          {DeviceModel}
{DeviceOperatingSystem}        {DeviceUidLastFour}                 {DeviceReportedName}                      {EmailPassword}

These standard Lookup values can be customized to fit your business specific use case. If the value returned by {EmailUserName} for example, is of a format that you need to alter, you can create a custom rule on how this value is returned. 


1. Let's say Email usernames are stored in the format "Joe Doe" but email addresses are of the form You can create a custom lookup field based on {EmailUserName} that returns this value in the required form of "John.Doe". 

- First navigate to System Settings > Device > General > Lookup Fields and Add a Custom Field

- We will replace the space in the {EmailUserName} value with a period and call this Custom Look Field "First.Last"


- {First.Last} is now an available lookup value to use in profiles. 


- Notice that the XML pushed to the device updates the Username value from "John Doe" to "John.Doe" in the Email Address.


2. More advanced Regular Expressions can also be used for more complicated operations. If you only wanted to extract the first name from {EmailUserName} you can use the following Regex: ^(\w+\b.*?){1}.


- The associated XML would look like:



Example - Substring with Prefix and Suffix

If you wanted to take the Enrollment Username (e.g. SFP0014p) and replace a substring of numbers with a prefix and suffix, use the below formula. In this example the Username is a service account named SFP0014p and "0014" represents the Store number. Each store has a local server with a hostname = "Q{StoreNumber}001". Setting up the regex replace of "^[^\d]+(\d+)[^\d]+$" will extract the 1st, 2nd, 3rd, 4th digit and set the replace to "Q$+001" to prefix the match with a "Q" and suffix with a "001".


Have more questions? Submit a request


Article is closed for comments.