I'm interacting with a webhook which provides a FORM struct with several variables containing brackets [ ]
. How can I utilize these variables within CFML?
Example:
FORM.PAYLOAD[SITE][ID]
FORM
is the struct
PAYLOAD[SITE][ID]
is the name of the variable within the FORM
struct.
All help is greatly appreciated!
I would rather suggest you to dump the
form
struct usingcfdump
like this-and see if
PAYLOAD[SITE][ID]
is a key ofform
struct or onlypayload
is the key.If the whole
PAYLOAD[SITE][ID]
appears as a key in the dump, then as @matt suggested, you can utilize the variables like this-ColdFusion does not natively handle structs or arrays within a forms.
In 2007, Brian Kotek created a tool that do that processing.
In 2013, I created a tool that worked with the then current version of FW/1 . The latest version of that tool can be found at: https://github.com/jmohler1970/BS-4-CF/tree/master/framework
Last but not least, I put in a ticket into Adobe bugbase to add that functionality natively: https://bugbase.adobe.com/index.cfm?event=bug&id=4156093