CSV upload with multiselect field not working right

This topic contains 6 replies, has 3 voices, and was last updated by  Paolo 10 years, 1 month ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket

Tagged: 

  • Author
    Posts
  • #17676

    pretium
    Expired Member
    Post count: 17

    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?

    #17679

    Guust
    Moderator
    Post count: 29970

    I’ll get Paolo to have a look at your question.

    #17707

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    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,

    #17865

    pretium
    Expired Member
    Post count: 17

    Hi 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.

    #17882

    Paolo
    Site Admin
    Post count: 31206

    Hi 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.

    #18812

    pretium
    Expired Member
    Post count: 17

    The 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).

    #18837

    Paolo
    Site Admin
    Post count: 31206

    Hi 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

Viewing 7 posts - 1 through 7 (of 7 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount