Mapquest URL Assembly

I want to insert a “generate map” action button in our sales contact Db. I thought about this combo…

FIELD add:=BusinessAddress;

FIELD city:=BusinessCity;

FIELD zip:=BusinessZip;

@URLOpen(“27673 Highway 72, Bouse, Arizona - MapQuest”)

I noted that each part of the address is separated by a “=”. How would I take the address in the BusinessAddress field and insert + between each word/number? Also, I am assuming that I would need to insert a “city” reference behind “&city=”. What is the exact syntax?

Subject: Mapquest URL Assembly

The URL in your code is simply a string. Use normal string manipulation to concatenate static text (“&city=”) and field references.

Subject: Mapquest URL Assembly

Hey Michael,

I do the very same thing, and use @URLEncode, for example:

@URLEncode(“Domino”;BusinessAddress)

This turns “123 Summit Ave” into “123%20Summit%20Ave”!

I use this approach to offer the users of my CRM product a choice between which online directions to use:

options := “MapQuest”:“Google Maps”:“Yahoo Maps”;

prompt :=

@If(

@Trim(StreetAddress+City+State+Zip) = “”;

@Do(

@Prompt([OK];“Address Information not found!”;“There is currently no address information for the selected document.”);

@Return(“”)

);

@Do(

@Prompt([OkCancelCombo]; “Map Engine Selection”; “Please select a Map Engine from the following list:”;@SubSet(options; 1);options)

)

);

SA := @URLEncode(“Domino”;StreetAddress);

C := @URLEncode(“Domino”;City);

S := @URLEncode(“Domino”;State);

Z := @URLEncode(“Domino”;Zip);

@If(

prompt = “MapQuest”;

@URLOpen(“Official MapQuest - Maps, Driving Directions, Live Traffic” + SA + “&city=” +C + “&state=” +S + “&zipcode=” + Z);

prompt = “Google Maps”;

@URLOpen(“Google Maps” + SA+ “,+” + C + “,+” + S + “,+” + Z );

prompt = “Yahoo Maps”;

@URLOpen(“Yahoo Search - Web Search” + SA+ “&csz=” + C+ “%2C+” + S+ “+” + Z);

@Return(“”))

This prompts them asking which direction engine they wish to use, and then launches the correlating URL with my address information values in the querystring parameters.

HTH,

-Chris

Subject: RE: Mapquest URL Assembly

Thanks very much for this, Christopher. You saved me an hour and that is valuable. I will raise a little toast to you this evening.

Subject: RE: Mapquest URL Assembly

Very Nice! I was trying and not getting it right. Thank you…

Subject: RE: Mapquest URL Assembly

You all are excellent! Thanks for the feedback… makes serious sense now.

Subject: Mapquest URL Assembly

Your example is missing the state field. Taking the URL you posted and breaking it apart you could probably do this:

FIELD add := BusinessAddress;

FIELD add := @Replace(add;" “;”+");

FIELD city := BusinessCity;

FIELD zip := BusinessZip;

FIELD state := BusinessState;

url := {27673 Highway 72, Bouse, Arizona - MapQuest};

url := url + {?address=} + add + {&city=} + city + {&state=} + STATE + {&zipcode=} + zip;

url := url + {&country=US&cid=lfmaplink’,’ blank};

@URLOpen(url)

I haven’t actually tried it or done it, but that makes logical sense to me.