urlBuilder

by Todd Geist

URL Builder helps you construct URLs in an easy and chainable manner.

For example, this FileMaker calculation

url ( "http://www.geistinteractive.com" ) &

urlBasicAuth ( "admin" ; "password" ) &
urlPath ( "contacts" ) &
urlPath ( "23345" ) &
urlParam ( "max" ; "100" ) &
urlParam ( "skip" ; "100" ) &

url ("") // always end the chain with this.

will return this:

http://admin:password@www.geistinteractive.com/contacts/23345?max=100&skip=100

It also has a special function to help build fmp URLs. So this

urlFMP ( "" ; "" ) & 
urlParam ( "script" ; "New Contact" ) & 
urlParam ( "firstName" ; "Todd" ) & 
urlParam ( "lastName" ; "Geist" )  & 

url ( "" )

returns

fmp://$/urlBuilder?script=New%20Contact&%24firstName=Todd&%24lastName=Geist

You don’t have to chain if you don’t want to. You can make each call in it’s own script step if you want. You also don’t have to use Custom Functions. Each Custom Function has a Script Only equivalent. So if you just want to use it in a script you can without having to import the Custom Functions. See the README script and the scripts in the Folder “url: Examples and Tests”.

Download the file: urlBuilder.fmp12

One response to “urlBuilder”

Leave a Reply

Your email address will not be published. Required fields are marked *