PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

easy way to convert normal fields into custom fields?

  1. shoesale
    Member

    Hi,

    I just downloaded the plugin and started to create a rather large form (40+ items all with advanced settings filled out). I've now realized that to get these to become post meta values they have to be defined as custom fields. Is there any easy way to covert a standard field to a custom field (even if it means having to edit code) that i can use to save having to re-write the entire form?

    Thanks in advance!

    Posted 13 years ago on Thursday April 12, 2012 | Permalink
  2. Well, you can export the form and open the XML file and try editing it that way to change the field types. For example, I did a quick test with a form that had a single line field and a post custom field. This was the output:

    <?xml version="1.0" encoding="UTF-8"?>
    <forms version="1.6.4.beta1">
    	<form labelPlacement="top_label" useCurrentUserAsAuthor="1">
    		<title><![CDATA[Post Fields Form]]></title>
    		<description><![CDATA[We would love to hear from you! Please fill out this form and we will get in touch with you shortly.]]></description>
    		<confirmation type="message">
    			<message><![CDATA[Thanks for contacting us! We will get in touch with you shortly.]]></message>
    		</confirmation>
    		<button type="text">
    			<text><![CDATA[Submit]]></text>
    		</button>
    		<fields>
    			<field id="1" type="text" size="medium">
    				<label><![CDATA[Single Input]]></label>
    			</field>
    			<field id="2" type="post_custom_field" size="medium" inputType="text">
    				<label><![CDATA[Post Custom Field]]></label>
    			</field>
    		</fields>
    		<descriptionPlacement><![CDATA[below]]></descriptionPlacement>
    		<notification>
    			<to><![CDATA[{admin_email}]]></to>
    			<subject><![CDATA[New submission from {form_title}]]></subject>
    			<message><![CDATA[{all_fields}]]></message>
    		</notification>
    	</form>
    </forms>

    You can see that in this simple example the "type" is different and the CDATA. IF you go this route, just do backups of the original XML and maybe some experimentation. Hopefully that could shortcut it for you. Once finished editing, you can reimport the XML file.

    Posted 13 years ago on Thursday April 12, 2012 | Permalink
  3. shoesale
    Member

    Thanks Rob,

    The export option through Wordpress gives me a CSV of the input data rather than the XML structure of the form, is there another export option for this?

    Posted 13 years ago on Thursday April 12, 2012 | Permalink
  4. Actually, you are in the right place, mostly. At the top of the Import/Export page you should see an option for Export Entries | Import Forms | Export Forms

    Posted 13 years ago on Thursday April 12, 2012 | Permalink
  5. shoesale
    Member

    Sorry, that was a stupid question, just found the link!

    Posted 13 years ago on Thursday April 12, 2012 | Permalink
  6. shoesale
    Member

    Ok, the way to do this for anyone with a similar problem is:

    download XML
    find 'type'
    replace 'type="post_custom_field" inputType'

    make sure you 'match whole word only' and run throuht the XML on a case by case basis (don't replace all)

    Posted 13 years ago on Thursday April 12, 2012 | Permalink
  7. Nice, so it worked! Cool man, thanks for posting.

    Posted 13 years ago on Thursday April 12, 2012 | Permalink

This topic has been resolved and has been closed to new replies.