Plugin Author
zaus
(@zaus)
If you map multiple source fields to the same destination field, you can merge them as an array using the separator [] or [#] — see the FAQ page, section “I need to submit multiple values as…”.
Thread Starter
arev
(@arev)
Hi,
Thank you for your answers.
Actually I need to get something like this:
“CUSTOMFIELDS”: [
{
“CUSTOM_FIELD_ID”: “sample string 1”,
“FIELD_VALUE”: {aaa}
},
{
“CUSTOM_FIELD_ID”: “sample string 1”,
“FIELD_VALUE”: {bbb}
},
{
“CUSTOM_FIELD_ID”: “sample string 1”,
“FIELD_VALUE”: {ccc}
}
],
Plugin Author
zaus
(@zaus)
Use my xpost add-on (I think you already are) and include a digit placeholder in nested mapping, like custom fields/%i/custom-field-id.
Thread Starter
arev
(@arev)
Hi zaus,
Thanks for your help, but I think I haven’t understood fully your suggestion.
Where do you suggest to add custom fields/%i/custom-field-id?
The plugins interface allows to fill Label, Form submission field and the 3rd-party field.
Thread Starter
arev
(@arev)
Hi zaus,
I tried to add the custom fields as following:
CUSTOMFIELDS%1/CUSTOM_FIELD_ID
CUSTOMFIELDS%1/FIELD_VALUE
CUSTOMFIELDS%2/CUSTOM_FIELD_ID
CUSTOMFIELDS%2/FIELD_VALUE
And the result I’m getting is:
[body] => {“CUSTOMFIELDS%1”:{“CUSTOM_FIELD_ID”:”Product Download”,”FIELD_VALUE”:”test2″},”CUSTOMFIELDS%2″:{“CUSTOM_FIELD_ID”:”Datasheet Download”,”FIELD_VALUE”:”wer”},”FIRST_NAME”:”Arev”,”LAST_NAME”:”Arev”,”TITLE”:”JK”,”ORGANIZATION_NAME”:”JK”,”PHONE_NUMBER”:”678951″,”EMAIL_ADDRESS”:”arev@gmail.com”,”ADDRESS_COUNTRY”:”Austria”,”LEAD_DESCRIPTION”:”Datasheet Download”,”LEAD_RATING”:”2″}
Could you please suggest what I’m doing wrong, or what else I should do to get json array instead.
Thanks.
Plugin Author
zaus
(@zaus)
Sorry for the misunderstanding, but placeholder is actually %i (the letter “i”).
So, in a totally arbitrary example, if you have a contact form with fields:
- [section1_fieldA]
- [section1_fieldB]
- [section2_fieldA]
- [section2_fieldB]
You would map:
- section1_fieldA –> custom fields/%i/custom-field-id
- section1_fieldB –> custom fields/%i/custom-field-value
- section2_fieldA –> custom fields/%i/custom-field-id
- section2_fieldB –> custom fields/%i/custom-field-value
where the mapped destination fieldnames just repeat. The numeric placeholder is a feature of the main F3P plugin that was added to support a scenario similar to yours (see also issue #7).