addressFormat
def addressFormat = {address, street, city, state, postalCode, country, latitude, longitude -> String[] addressArray
if (address || city || state || street|| country || postalCode || latitude || longitude){
addressArray = new String[10]
addressArray[0] = address
addressArray[2] = street
addressArray[3] = city
addressArray[4] = state
addressArray[5] = postalCode
addressArray[6] = country
addressArray[7] = latitude
addressArray[8] = longitude
}
return addressArray
}
Formats an address and gets a constructed address array. The value of address is full address.
Example
"core_address":"addressFormat
(
null,fields.SVMXC__Street__c,
fields.SVMXC__City__c,
fields.SVMXC__State__c,
fields.SVMXC__Zip__c,
fields.SVMXC__Country__c,
fields.SVMXC__Latitude__c,
fields.SVMXC__Longitude__c
)"
Sample Transforms
Original Values
Transformed Values
Name
Value
Name
Value
SVMXC__Street__c
2425 Samaritan Dr
core_address
[,,2425 Samaritan Dr,San Jose,CA,95124,United States,37.2517475,-121.9466889]
SVMXC__City__c
San Jose
SVMXC__State__c
CA
SVMXC__Zip__c
SVMXC__Zip__c
SVMXC__Country__c
SVMXC__Country__c
SVMXC__Latitude__c
SVMXC__Latitude__c
SVMXC__Longitude__c
SVMXC__Longitude__c
For more information:
Was this helpful?