2022.2

Table Of Contents
Groupingdatausingarrays
Groupingdatausingarrays
InaConnectsolution,whenaWebFormorCOTGFormissubmitted,thereisaWorkflowprocessthat
receivesthedataandcreatesajob data file(whichisanXMLfile).Havingarraysinthejobdatafile
greatlysimplifiescreatingadatamappingconfigurationandloopingoverdatainDesignerscripts.
Here'showtogroupdataintheHTMLsothattheygetsubmittedasarrays.
Note: Toenablesubmittingarrays,youneedtochecktheUse PHP arraysorUse enhanced
PHP arraysoptionintheHTTPServeruserpreferencesinWorkflow;seeWorkflowOnlineHelp.
Asimplemethodtocreatearraysinthejobdatafileistousetwo pairs of square bracketsinthe
nameoftheforminputs.Putthenameofthearraybetweenthefirstpairofsquarebrackets.Between
thesecondpairofsquarebrackets,definethekeytowhichthevaluebelongs.Considerthefollowing
HTMLforminputs:
<input type="hidden" name="user_account" value="pparker@eu.objectiflune.com">
<input type="text" name="name" value="Peter Parker">
<input type="text" name="company" value="Objectif Lune">
<input type="text" name="pinElm1[pin_0][left]" value="122">
<input type="text" name="pinElm1[pin_0][top]" value="253">
<input type="text" name="pinElm1[pin_0][type]" value="dent">
<input type="text" name="pinElm1[pin_1][left]" value="361">
<input type="text" name="pinElm1[pin_1][top]" value="341">
<input type="text" name="pinElm1[pin_1][type]" value="dent">
WiththeUse PHP arraysoptionenabledinWorkflow,theaboveHTMLresultsinthefollowingXML:
<values count="4">
<user_account>pparker@eu.objectiflune.com</user_account>
<name>Peter Parker</name>
<company>Objectif Lune</company>
<pinElm1>
<pin_0>
<left>122</left>
<top>253</top>
<type>dent</type>
</pin_0>
<pin_1>
<left>361</left>
<top>341</top>
Page 539