simple geochart not rendering any data

  • 2
  • Question
  • Updated 4 years ago
  • Answered
I've put together a really simple Geochart that 'should' render a count of Accounts based on BillingCountry and BillingState. No buckets and only default styling used.

The 'series' is using the Count function on the Id field, and BillingState and BillingCountry are both in the model. I've also tried using BillingCountryCode and BillingStateCode picklist fields instead, but no luck.

I feel like there's something really simple that I've missed, but can't seem to figure it out. I've copied the page xml below - if anyone has any tips I'd greatly appreciate it.


<skuidpage unsavedchangeswarning="yes" showsidebar="true" showheader="true" tabtooverride="Account">
   <models>
      <model id="Account" limit="100" query="true" createrowifnonefound="false" sobject="Account" doclone="" type="" orderby="LastViewedDate Desc">
         <fields>
            <field id="Name"/>
            <field id="CreatedDate"/>
            <field id="BillingCountry"/>
            <field id="BillingCity"/>
            <field id="BillingState"/>
            <field id="BillingStreet"/>
            <field id="Id"/>
            <field id="LastViewedDate"/>
            <field id="BillingCountryCode"/>
            <field id="BillingStateCode"/>
         </fields>
         <conditions>
            <condition type="blank" value="null" field="BillingCountry" operator="!=" enclosevalueinquotes="false"/>
            <condition type="blank" value="null" field="BillingState" operator="!=" enclosevalueinquotes="false"/>
         </conditions>
         <actions/>
      </model>
   </models>
   <components>
      <pagetitle model="Account">
         <maintitle>
            <template>{{Model.labelPlural}}</template>
         </maintitle>
         <subtitle>
            <template>Home</template>
         </subtitle>
         <actions>
            <action type="savecancel"/>
         </actions>
      </pagetitle>
      <skuidvis__geochart model="Account" maintitle="{{Model.labelPlural}}" maptype="us-all" height="600px" backgroundcolor="#9bc6cf" nullcolor="#eee" rbwidth="0" dlcolor="black" dlbold="false" dlstrokewidth="0" mapgroup="na" dlformat="">
         <colors>
            <value>#afbfff</value>
            <value>#91a7ff</value>
            <value>#738ffe</value>
            <value>#5677fc</value>
            <value>#4e6cef</value>
            <value>#455ede</value>
            <value>#3b50ce</value>
         </colors>
         <legend/>
         <serieslist>
            <series joinBy="hc-key" valueField="Id" countryfield="BillingCountry" modelId="Account" statefield="BillingState" aggFunction="count"/>
         </serieslist>
         <buckets/>
         <renderconditions logictype="and"/>
      </skuidvis__geochart>
      <skootable showconditions="true" showsavecancel="false" searchmethod="server" searchbox="true" showexportbuttons="false" pagesize="10" createrecords="true" model="Account" mode="read">
         <fields>
            <field id="Name" allowordering="true"/>
            <field id="CreatedDate" allowordering="true"/>
            <field id="BillingCity"/>
            <field id="BillingCountry"/>
            <field id="BillingState"/>
         </fields>
         <rowactions>
            <action type="edit"/>
            <action type="delete"/>
         </rowactions>
         <massactions usefirstitemasdefault="true">
            <action type="massupdate"/>
            <action type="massdelete"/>
         </massactions>
         <views>
            <view type="standard"/>
         </views>
      </skootable>
   </components>
   <resources>
      <labels/>
      <css/>
      <javascript/>
   </resources>
</skuidpage>

Photo of Greg Jarrett

Greg Jarrett

  • 3,496 Points 3k badge 2x thumb

Posted 4 years ago

  • 2
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
I wanted to know as well. Happy charting!

Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
er .... uh .... that's not what the issue was.

What Country code do you have? USA doesn't work. US does.
(Edited)
Photo of Greg Jarrett

Greg Jarrett

  • 3,496 Points 3k badge 2x thumb
Well this is odd - mine are both full text for country/state code (the picklist data type) and for BillingCountry/BillingState fields (string data type).

I do have state & country picklists enabled so that might affect things. I had thought the BillingCountryCode (picklist field) would bring up the 2-letter country code (which is coming up as 'US' in my state & country settings).

Still can't get it to work...

Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
I'm using the 2 char strings for it to work. Seems to only work with 2 char strings. Those code fields. Are they custom fields? I don't remember seeing them.
Photo of Greg Jarrett

Greg Jarrett

  • 3,496 Points 3k badge 2x thumb
ah ha! that would be the reason. I created a custom text formula field on the Account model which just contains "US", and now its rendering (all accounts based in the US) - so it must be operating on the 2-letter country code.

However, the 2-letter code doesn't appear to be available to my model - I would think it has something to do with state & country picklists - have you got them enabled or not?

Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
I don't have anything except a text field where the 2 char code is typed in. Not the most elegant. Hopefully there is something better than this.
Photo of Irvin Waldman

Irvin Waldman, Champion

  • 9,006 Points 5k badge 2x thumb
I went ahead and enabled State and Country picklists to see if it would work in my org.  Does not seem to work.








(Edited)
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
2 character codes is all that seems to work.
Photo of Irvin Waldman

Irvin Waldman, Champion

  • 9,006 Points 5k badge 2x thumb
Country codes and State/Province codes are two character codes.  This will probably be cleared up once documentation is provided.  
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Oh! I haven't yet used this feature. Looking into it now.
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
The codes must on another object or something. Looking for it now.
(Edited)
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
K. Well. That is weird. The value of the code fields are not what is being passed into the geo chart.

I created two text formula that simply converts the code fields to text. The proper 2 char is is the result.

These picklist fields are odd. They display differently than the values stored.

Photo of Irvin Waldman

Irvin Waldman, Champion

  • 9,006 Points 5k badge 2x thumb
We need documentation :).  This very well may be a backlog item.  If so, your suggestion seems to be a fine interim solution for using country/state/province picklists.  Just gotta luv dem formula fields!
(Edited)
Photo of J.

J., Official Rep

  • 7,470 Points 5k badge 2x thumb
Hi, guys. Thanks for helping us kick the tires a bit on GeoCharts. We're excited to see how you use it! It looks like you already found the tie in to State and Country Picklists. The maps we deliver are made to play nicely with your data if you use this Salesforce feature, but as you noticed, you did uncover a bug (and a workaround!). I've already got it patched up in our Dev Org, and it should go out with our next patch release. We are also continuing to beef up our documentation, so look for updates to that in the near future.

Just to save anyone who may stumble across this thread some time catching up, the country and state values used by the maps we deliver correspond to two character ISO codes. If your org has full country names or some other abbreviations (e.g. "U.S.A."), you'll need to convert the data or use formula fields to translate it. Creating one off formula fields is a quick way to get results, but of course, that only works one object at a time, and isn't the most scalable solution. Salesforce also prevents grouping on Formula Fields in aggregate queries. The aforementioned Salesforce State and Country Picklists feature can help too, but be warned, it is a process that takes time to implement and you can't go back once you enable it, so be sure to read up on it and try it out in a testing environment first.
Photo of Greg Jarrett

Greg Jarrett

  • 3,496 Points 3k badge 2x thumb
Thanks guys. No worries. Good to know I'm not going mad at least.
Photo of Peter Baeza

Peter Baeza

  • 2,868 Points 2k badge 2x thumb
http://www.highcharts.com/maps/demo/all-maps#custom/world has demos showing the different areanames that can be used. I think these are the sames that Skuid uses.
Photo of Chad Kelly

Chad Kelly

  • 60 Points
ISO Codes for Countries, State Postal Codes for States... how about counties?
Photo of J.

J., Official Rep

  • 7,470 Points 5k badge 2x thumb
The county maps all use three digit FIPS codes (http://www.census.gov/geo/reference/codes/cou.html). So for Hamilton County, TN, the country code would be US, the state code would be TN, and the county code would be 065.
Photo of Chandra V

Chandra V, Champion

  • 6,966 Points 5k badge 2x thumb
Hey all... Just a comment, you might want to add the county code thing to the tutorial document.  I followed that document and my counties didn't show up, but I found this to be the reason.  Now off to convert my counties to codes...
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Thanks Chandra.  I'll pass this along to our documentation guru. 
Photo of Josh Cutler

Josh Cutler, Official Rep

  • 864 Points 500 badge 2x thumb
Thanks for letting us know!

I've updated the documentation to include information on the County FIPS Code when charting county data.

Also, I included a note on the proper ISO code for fictional countries (ZZ). Just in case, you happen to do business with Narnia.
(Edited)