CSV upload with multiselect field not working right
This topic contains 6 replies, has 3 voices, and was last updated by Paolo 10 years ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support TicketTagged: csv upload
-
AuthorPosts
-
October 7, 2014 at 12:19 pm #17676
I created a number of custom fields including one that has a multiselect field set to operate as checkboxes (Riding Sports field). Now I am trying to upload data using a csv file. The data load correctly up to the custom data fields, the first of which is this multiselect field. Actually I left it blank (no data in field) hoping to bypass it entirely since it is not required, but the data for the following fields (which contain several radio buttons) didn’t load correctly. Interestingly I was able to load the core data for 5 new places, but not the data for the custom fields for each. For each of the radio buttons, am I correct that I only need to load a 1 or 0 – most of these loaded as No even though some are Yes? (You can see the attached cdv file.) I want to get this working so that I can load somewhere close to 100 records using a csv file. Can you tell me what I am doing wrong and how to make this work?
October 7, 2014 at 12:49 pm #17679I’ll get Paolo to have a look at your question.
October 7, 2014 at 7:03 pm #17707Hi,
I would really need your website url and credentials to be 100% sure, but I see a couple of things that look wrong.
1) In the author column you should use the ID, not the username.
2) Custom fields should be added at the end of the file after IMAGES
3) Custom fields name should be geodir_html_variable. Not gd_html_variable.
I suspect that fixing this 3 things would solve, but without testing I can’t be 100% sure.
What I normally do to give support when somnthing isn’t working as it should is to check in phpmyadmin (or by installing the database browser plugin), add all custom fields from the front end or back end forms to 1 listing and check how they were added to the geodir_gd_place_detail table.
Following the right format in the CSV it never fails.
Let us know,
October 9, 2014 at 1:50 pm #17865Hi Paolo,
So even if the custom fields are in order ahead of the regular fields in the list, in the csv file the data for the custom fields should come after the images? In the order of their list?
I will try your suggestions, and if they solve the issues I will tell you; otherwise I will give you the access details.
Thank you.October 9, 2014 at 4:51 pm #17882Hi pretium,
The order you set in the back end is made via php, but it doesn’t modify the order of the fields in the database.
In doesn’t matter if the custom fields are in any exact order, just add them at the end of the file after images.
Most important thing though is to use the correct field name (geodir_xxx and not gd_xxx )
Please let us know.
October 18, 2014 at 2:05 pm #18812The cdv upload works with the custom fields at the end. I still have a problem with a field for a multiselect checkbox – how do I enter the data in the field so the individual boxes are checked? Also, how do I know the regions for the location, or does it matter as long as I put something? By the way, the author column can correctly handle both the username and the ID (my earlier upload with the username entered that field fine, and a later upload with the number also worked fine).
October 18, 2014 at 5:24 pm #18837Hi Pretium,
The best way to learn how to do this without erros, is to add 1 custom field manually from the front end or back end form. Than with phpmyadmin or a plugin like “database browser” check how the data is entered in the database table: geodir_gd_place_detail (if gd_place is the CPT used)
Example:
In the demo I created a multiselect custom fields with check boxes called : test.
Values for it are : Alpha, Beta and Gamma.
In my CSV is added the column : geodir_test
As value I entered : Alpha, Beta
and this is the result: http://wpgeo.directory/attractions/united-states/illinois/chicago/landmark/willis-tower/#post_info
Thanks
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket