Formatting a list field for GFAPI entry-Pre_submission

Ahoy to the community,

I have tried to do the utmost of digging through all of the documentation but my search has been in vain.

Is there any built in functionality that is available to the plebs that would take the $_POST or $form data available during gform_pre_submission, take a list field and correctly format and serialize so it can be used in GFAPI::create_entry().

The format I need:
a:1:{i:0;a:5:{s:7:“Company”;s:4:“asdf”;s:5:“Brand”;s:8:“asdfasdf”;s:8:“Retailer”;s:4:“asdf”;s:28:“List all claims on packaging”;s:4:“asdf”;s:36:“List all certifications on packaging”;s:4:“asdf”;}}

The format I get:
a:5:{i:0;s:4:“asdf”;i:1;s:8:“asdfasdf”;i:2;s:4:“asdf”;i:3;s:4:“asdf”;i:4;s:4:“asdf”;}

Any insights would be greatly appreciated and am never too humble to be called out on missing something obvious.

If there is nothing I can do within GF I can always build something meself.

May all your hits be crits.

Thanks for the tagging, I can no longer edit though so I will add my final question here.

Would it be better to try the gform_after_submission instead and change everything to use the submit_form() option? If this sounds viable would the list fields need to be unserialized to be passed as input_values to the submit_form() to be re-serialized? :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.