Brian Dunning's FileMaker Custom Functions

ParseUrl ( _url )

Parse the URL and return the result as JSON.

  Be the first to rate this function Log in to vote

Teruhiro Komaki   Teruhiro Komaki - Show more from this author
frudens Inc.
https://frudens.jp

Share on Facebook Share on Twitter

  Sample input:
ParseUrl ( "https://username:password@bucketname.s3.ap-northeast-1.amazonaws.com:80/dir1/file.txt?q1=v1&q2=v2#fragment" )
  Sample output:
{
"fileName" : "file.txt",
"fragment" : "fragment",
"host" : "bucketname.s3.ap-northeast-1.amazonaws.com",
"password" : "password",
"path" : "/dir1/file.txt",
"port" : "80",
"query" : "q1=v1&q2=v2",
"scheme" : "https",
"urlIsEmpty" : true,
"userName" : "username"
}

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

Parse the URL and return the result as JSON.

- If urlIsEmpty is 'false', the URL may have failed to parse.
- Please let me know if there is anything I have overlooked.
- For the structure of the URL, I referred to the URL below.
https://en.wikipedia.org/wiki/URL

 

Comments

João Coutinho   João Coutinho
Nov 24, 2022
Nice!!
 

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 18 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: