Background
There is no RFC or other standard for how systems are to structure multi-select form field values in HTTP requests. While the HTML Select element is well-defined, there is nothing in either HTML or HTTP RFCs that address how to format the selected data. It’s the wild west, especially when the request’s Content-Type is application/x-www-form-urlencoded.
The request structure we see most commonly uses multiple name=value parameters, each named for the HTML element:
…&name-item1&name=item2&…
But we’ve also seen formats like:
…&name[0]=item1&name[1]=item2&…
…&name=[item1,item2]&…
Submitting Multi-Select Data to LeadConduit
For application/x-www-form-urlencoded request bodies, LeadConduit recognizes multiple name=value parameters.
String multi-select data can be captured by LeadConduit array-type or string-type flow fields. Numeric multi-select data can be captured by LeadConduit number-type flow fields.
Example:
/submit?array1_demo= first&array1_demo= second&reference= ref1&reference= ref2&annual_salary= 10000&annual_salary= 20000
The instances of each parameter are captured and stored as array/list elements:
Multi-select parameters are only supported for key=value&key=value… string request formats. They are not supported for Json or XML submission request.
Setting Acceptance Criteria
Acceptance criteria can be enforced by using an “OR” rule set with the “includes” operator. Also, numeric-type fields can be evaluated using relative-value operators. The above submit string meets all of these acceptance criteria:
Outbound Mapping
For outbound mapping of arrays/lists, array-type field elements (not string or numeric type field elements) can be individually mapped by index number.
Not specifying an index simply maps multiple instances of the parameter, each with a different index:
Outbound Mappings:
Resulting POST parameter string:
Array_All= first&Array_All= second&Array_0= first&Array_1= second&Array_last= first&Array_last= second&Ref_all= ref1&Ref_all= ref2&salary= 10000&salary= 20000
- mceclip0.png30 KB
- mceclip1.png20 KB
- mceclip2.png50 KB
- mceclip4.png60 KB
- mceclip3.png30 KB
Comments
0 comments
Please sign in to leave a comment.