FMP URL Protocol and #Parameters

319 views
Skip to first unread message

Todd Geist

unread,
Aug 7, 2014, 12:01:35 PM8/7/14
to modular-...@googlegroups.com
Hey Jeremy and Dan et all

The fmp url protocol provides a native way of calling scripts by name and with multiple parameters. Where it works, it works really well. It doesn't work on Server Side Scripts, PSOS and WebDirect. But it works on Pro and Go just like using Perform Script.  It starts immediately, and even returns a script result.

I don't think we can declare this to be the standard, since it doesn't work across the whole platform, and still requires complex string construction.  But what about adding a function to #Parameters to convert Let notation into the valid query parameters?  Or even one that creates the entire URL to use with open URL?

#URLQuery( "$name=\"Todd\"; $age=47" )  =>  "$name=Todd&$age=47

or

#FMPURL(scriptName ; $letVars ; optionalFileName ; optionalHost )  => fmp://$/Contacts?script=ScriptName&$name=Todd&$age=47


The other option would be to add this to the new urlBuilder Module I just released.


What do you think?

Todd

Daniel Smith

unread,
Aug 7, 2014, 1:06:53 PM8/7/14
to modular-...@googlegroups.com
I think it's more fitting for these functions to be in the urlBuilder Module. I would rather keep the #Parameters module focused on it's current task of encoding/decoding data and parameter assignment.


--
You received this message because you are subscribed to the Google Groups "Modular FileMaker" group.
To unsubscribe from this group and stop receiving emails from it, send an email to modular-filema...@googlegroups.com.
To post to this group, send email to modular-...@googlegroups.com.
Visit this group at http://groups.google.com/group/modular-filemaker.
To view this discussion on the web visit https://groups.google.com/d/msgid/modular-filemaker/f589404a-cf0f-482a-aae3-d301eb3a5952%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Matt Petrowsky

unread,
Aug 8, 2014, 3:39:53 PM8/8/14
to modular-...@googlegroups.com

jeremy...@gmail.com

unread,
Aug 8, 2014, 6:45:15 PM8/8/14
to modular-...@googlegroups.com
I'm not as sure as Dan & Matt that this obviously makes more sense as part of urlBuilder than #-parameters. If assigning parameters from encoded strings, such as script parameters and result, to variables is part of the purpose of #-parameters, isn't this consistent with that purpose?

On the other hand, #-parameters is designed to be a coherent set of functions operating on one data format, whereas this would be a new data format. Dan spun conversion between JSON and Let Notation off as a separate module rather than making it part of #-parameters, and I think that was definitely the way to go for that case.

I haven't tested this, but I presume that URL variables also wouldn't be capable of the data type preservation feature of #-parameters. If scripts are accepting parameters either as Let Notation or as URL variables, any scripts sensitive to the data types of the incoming data will have to coerce data type to accomodate the URL variables, which renders the type detection in #-parameters redundant. So maybe losing that feature in format conversion is ultimately less of a concern anyway.

Would it be so much of a burden for scripts using Let Notation parameters to be called with "param=" in their URLs instead of variables? Sure, that will make the URL more verbose, but so what? The URL and parameter values will be less human-readable, but URLs are pretty difficult to read in the first place. How frequently are we sending so many parameters that are so long that we run against the limit of how long URLs can be? I ran a test a few weeks ago, which was limited to intra-file URLs running locally on a Mac, and I crashed FileMaker before there was a limit on how big the URL could be.

Todd Geist

unread,
Aug 8, 2014, 7:28:55 PM8/8/14
to modular-...@googlegroups.com
Thanks for everyone's thoughts on this.

The only real pro I see to passing params with fmp URLs is not having to evaluate anything in the receiving script.  That doesn't seem to be that compelling.

maybe the module that makes the most sense for this is the Parameter Conversion module that Donovan did?

But other than that I am not feeling the need to do anything more...

Todd


--
You received this message because you are subscribed to the Google Groups "Modular FileMaker" group.
To unsubscribe from this group and stop receiving emails from it, send an email to modular-filema...@googlegroups.com.
To post to this group, send email to modular-...@googlegroups.com.
Visit this group at http://groups.google.com/group/modular-filemaker.

For more options, visit https://groups.google.com/d/optout.



--
Todd Geist
Reply all
Reply to author
Forward
0 new messages