Print this page

How to use Geo-Location field in different Salesforce formula functions?

Knowledge Article Number 000182392
Description When we create formula field on Geo-Location data type field, It will not return correct result as expected. When we create Geo-Location field there are two more fields will get created to capture Longitude and latitude to find out the location. We have to write formula on the two sub-fields to check the data in Geo-location field.

 
Resolution
Below are the different workarounds to check the data in Geo-Location data type fields.

1: How to use in ISBLANK () function.
  • The ISBLANK () function won't work with fields of data type "Geo Location". Instead we need to use latitude and longitude fields created automatically when we create Geo-Location field.
  • Use the below formula to check whether the Geo-Location field is blank or not.
                       AND
                         (
                         Location__latitude__s = 0,
                         Location__longitude__s=0
                         )
                   
 
  • The above formula will return true if the Geo-Location field is blank.

2: How to take export of Geo-Location field.
  • To take the export of Geo-Location, first we need to convert the field in to the data type as TEXT and then we can take the export of field.
  • Use the below formula to create a new field with return type as TEXT.
                            TEXT (Location__Latitude__s)
                            & (Concatenate Operator)
                             ' '
                            & (Concatenate operator)
                            TEXT (Location__Longitude__s)
  • Use the above newly created field while exporting.




promote demote