Support has been upgraded!
The Support Forum is closed. Not to worry! Providing the top quality support you expect and we're known for will continue! We're not ending support, just changing where you submit requests. This will provide you with the best experience possible.
Premium Support
Have you purchased an addon for Connections such as one of our premium templates or extensions with a valid license and you need help?
Please open a Support Ticket in your user account.
Free Support
Are you using the free Connections plugin? Don't worry, you are still very important to us! We are still providing you with the same high quality support that we're known for.
Please open a new support topic in the WordPress support forums for Connections.
Tagged: 8.36.1, csv export, custom fields, feature request
- This topic has 12 replies, 2 voices, and was last updated 7 years, 6 months ago by
Margo Bowie.
-
AuthorPosts
-
01/24/2019 at 5:14 pm #482587
Margo Bowie
ParticipantIve had to set up some custom fields to put in some html code on the profiles, but those don’t see to get exported. Would love this feature…or better yet, to have the fields build in like the Dates, Email Address, Phone Numbers… would be great to have ‘text entry’ where you could set the Title and then what is in it.
Attachments:
You must be logged in to view attached files.01/25/2019 at 9:27 am #482628Steven Zahm
Keymaster@ Margo
You could use this dev doc to register those fields with Connections so they can be exported:
https://connections-pro.com/quicktip-custom-field-adding-a-text-field/#Export_the_Field
Something like this should work:
// Register the custom test field CSV Export attributes and processing callback. add_filter( 'cn_csv_export_fields', 'cn_register_text_field_header' ); add_filter( 'cn_csv_export_fields_config', 'cn_register_text_field_config' ); function cn_register_text_field_header( $fields ) { // The field_id should match exactly the field id used when registering the custom field. $fields['Branch Logo'] = 'Branch Logo'; $fields['Marker Location'] = 'Marker Location'; return $fields; } function cn_register_text_field_config( $fields ) { $fields[] = array( 'field' => 'Branch Logo', // The field_id should match exactly the field id used when registering the custom field. 'type' => 5, 'fields' => '', 'table' => CN_ENTRY_TABLE_META, 'types' => NULL, ); $fields[] = array( 'field' => 'Marker Location', // The field_id should match exactly the field id used when registering the custom field. 'type' => 5, 'fields' => '', 'table' => CN_ENTRY_TABLE_META, 'types' => NULL, ); return $fields; }Hope this helps!
01/25/2019 at 3:33 pm #482664Margo Bowie
ParticipantThis is great!!! Almost works… the export works nice, but on import, there is no selection option for the Branch Logo and Marker Location (it defaults to Do Not Import, and is not available in the dropdown selection)…easy fix?
01/25/2019 at 3:34 pm #482666Margo Bowie
Participantusing Connections : CSV Import
01/25/2019 at 3:36 pm #482667Steven Zahm
Keymaster@ Margo
Just like you had to register the fields for export, you have to register them for import.
Here’s the link to the docs:
https://connections-pro.com/quicktip-custom-field-adding-a-text-field/#Import_the_Field
Hope this helps!
01/25/2019 at 4:03 pm #482669Margo Bowie
ParticipantI got this error…. Your PHP code changes were rolled back due to an error on line 117 of file wp-content/themes/divi-child/functions.php. Please fix and try saving again.
syntax error, unexpected ‘cnEntry_Action’ (T_STRING)
this is my code…
// Register the custom fields CSV Import mapping options and processing callback. add_filter( 'cncsv_map_import_fields', 'cncsv_header_name' ); add_action( 'cncsv_import_fields', 'cncsv_process_import', 10, 3 ); function cncsv_header_name( $fields ) { // The field_id should match exactly the field id used when registering the custom field. $fields['Branch Logo'] = 'Branch Logo'; $fields['Marker Location'] = 'Marker Location'; return $fields; } function cncsv_process_import( $id, $row, $entry ) { // The field_id should match exactly the field id used when registering the custom field. $data = $entry->arrayPull( $row, 'field_id', '' ); $data = cnFormatting::maybeJSONdecode( stripslashes( $data ) ) cnEntry_Action::meta( 'update', $id, array( array( 'key' => 'Branch Logo', // The field_id should match exactly the field id used when registering the custom field. 'value' => $data ), ) ); cnEntry_Action::meta( 'update', $id, array( array( 'key' => 'Marker Location', // The field_id should match exactly the field id used when registering the custom field. 'value' => $data ), ) ); }01/25/2019 at 4:16 pm #482670Margo Bowie
Participantline 177 is this
cnEntry_Action::meta(01/25/2019 at 4:28 pm #482673Steven Zahm
Keymaster@ Margo
You missing a trailing semicolon on the previous line of code.
// Register the custom fields CSV Import mapping options and processing callback. add_filter( 'cncsv_map_import_fields', 'cncsv_header_name' ); add_action( 'cncsv_import_fields', 'cncsv_process_import', 10, 3 ); function cncsv_header_name( $fields ) { // The field_id should match exactly the field id used when registering the custom field. $fields['Branch Logo'] = 'Branch Logo'; $fields['Marker Location'] = 'Marker Location'; return $fields; } function cncsv_process_import( $id, $row, $entry ) { // The field_id should match exactly the field id used when registering the custom field. $logo = $entry->arrayPull( $row, 'Branch Logo', '' ); $logo = cnFormatting::maybeJSONdecode( stripslashes( $logo ) ); $marker = $entry->arrayPull( $row, 'Marker Location', '' ); $marker = cnFormatting::maybeJSONdecode( stripslashes( $marker ) ); cnEntry_Action::meta( 'update', $id, array( array( 'key' => 'Branch Logo', // The field_id should match exactly the field id used when registering the custom field. 'value' => $logo ), array( 'key' => 'Marker Location', // The field_id should match exactly the field id used when registering the custom field. 'value' => $marker ), ) ); }01/25/2019 at 4:52 pm #482676Margo Bowie
Participantok thank you! The value(s) are not being imported for some reason…
for instance:

should be the value of the Branch LogoAttachments:
You must be logged in to view attached files.01/25/2019 at 4:53 pm #482678Margo Bowie
Participant
-
AuthorPosts
- You must be logged in to reply to this topic.
