Google Maps for Organisations

A few weeks ago, in this post, I explained how to embed Google Maps on RightNow CX, in order to quickly see the Contacts’s address using the information in the RightNow database.

Some of you asked if this was possible to do with Organisations. The answer was: unfortunately it is not as straight forward as with Contact, and there is two reasons for that:

a) The Address field in Organisation – “Oaddr” – is different than that in the Contact. It is a collection of addresses that has two types: Billing and Shipping. These are controlled by objects “Organization Addresses” and “Organization Address Types”.

b) Address values in Organisation are not available to get directly. “Oaddr” is expressed as string XML data of the following form:

<Addr Street=”123 main st” City=”Bozeman” ProvId=”23″ PostalCode=”59718″ CountryId=”1″ />.

The suggestion to get this done was to use a Desktop Integration with RightNow Connect JavaScript API in 4 stages:

  1. Get and parse the Organisation address
  2. Retrieve the values (Street, City, Province, Postal Code, Country)
  3. Build a Google Maps URL with the values
  4. Navigate to Google Maps using “window.location”

The solution is then:

  • Step 1: Create an HTML file with the JavaSCript code to build the Google Maps URL

<script type=“text/javascript”>

function getAddress()
var selection=document.getElementById(‘address_type’).value;
//0 for billing addr and 1 for shipping addr
var address = window.external.Org.OAddresses;
var org=window.external.Org;
var provinceName;
var countryName;

//Parsing the XML into object
var xmlDoc = new ActiveXObject(“Microsoft.XMLDOM”);
xmlDoc.async = “false”;

//Retrieving all the fields of selected Organisation Address
var desiredAddress=xmlDoc.getElementsByTagName(“OAddresses”)[0];

var street=desiredAddress.getElementsByTagName(“Addr”)[selection].getAttribute(“Street”);
var city=desiredAddress.getElementsByTagName(“Addr”)[selection].getAttribute(“City”);
var provId=desiredAddress.getElementsByTagName(“Addr”)[selection].getAttribute(“ProvId”);

var postalCode=desiredAddress.getElementsByTagName(“Addr”)[selection].getAttribute(“PostalCode”);
var countryId=desiredAddress.getElementsByTagName(“Addr”)[selection].getAttribute(“CountryId”);

//Fetching Province Name corresponding to provinceID retrieved
var provLabels = org.GetNameValues(“ProvId”);
var x=xmlDoc.getElementsByTagName(“Item”);
for (i = 0; i < x.length; i++)
var provAttlist=x.item(i).attributes;
var provAtt=provAttlist.getNamedItem(“Id”);
if (provAtt.value==provId)
provinceName= provAttlist.getNamedItem(“Name”).value;

//Fetching Country Name corresponding to countryId retrieved
var countryLabels = org.GetNameValues(“CountryId”);
var y=xmlDoc.getElementsByTagName(“Item”);
for (i = 0; i < y.length; i++)
var countAttlist=y.item(i).attributes;
var countAtt=countAttlist.getNamedItem(“Id”);
if (countAtt.value==countryId)
countryName= countAttlist.getNamedItem(“Name”).value;

//Building the google maps URL
var finalAddress=street+” “+city+” “+postalCode+” “+ provinceName+” “+countryName;

function ondataupdated(obj)

<body onload=getAddress()>

  • Step 2: Upload the HTML file to a server via FTP (I normally use FileZilla).
  • Step 3: Add a new tab to the Organisations Workspace and drag and drop a browser control into the tab


  • Step 5: Select the browser control, go to the Design tab > Options section, and put the URL path of the HTML file into the URL field.


  • Step 6: Select the browser control, go to the Design tab > Options section, and un-check the Delay Page Load check box.


Now, whenever you open an Organisation, and navigate to the “Map” tab, you will automatically see the Organisations’s address on the map.

Thank you to Bhagwan Singh Mer (Lead Consultant at Wipro Technologies) and Jens Lundell (Oracle RightNow Workflow Development Manager) for their help on this requirement. Special thank you to Saurabh Gupta (Consultant at Wipro Technologies) as it was him that scripted the JavaScript code.

Google Maps on RightNow CX

RightNow CX gives us the ability to put Web Browser controls in workspaces so that agents using the Dyanamic Agent Desktop can navigate on the Internet without having to leave the Console.

Using that we can easily embed Google Maps on RightNow CX, and quickly see the customer’s address using the information in the RightNow knowledge base.

  • Step 1: Open the workspace and add a new workspace tab
  • Step 2: Go to the Insert Control tab and drag/drop a browser control into the workspace tab


  • Step 3: Select the control in the workspace tab, go to the Design tab > Options section, click URL and insert the following link$contact.addr.street+$$contact.addr.postal_code


Now, whenever you open a contact, and navigate to the “Map” tab, you will automatically see the customer’s address on the map.