How to accomplish partial listing updates?

This topic contains 5 replies, has 3 voices, and was last updated by  Naveen Giri 4 years, 7 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #506900

    Daniel
    Expired Member
    Post count: 19

    I feel like this must be an old question, but I’m not seeing any answers later than 2016. I have ~7K places in gd_places and occasionally add custom fields to enrich the content. Is there any way to do partial record updates to fill out new fields or just the old ones? I’m pretty sure the cvs import update requires the entire record. So does this mean using SQL procedures with the underlying database, or can the API handle this? My preference would be to use the file upload functionality, but guess that is not in cards?

    Thanks!!

    #506944

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hi Daniel,

    You can CSV export and then CSV import to update, is there a reason not to do it this way?

    Thanks,

    Stiofan

    #507195

    Daniel
    Expired Member
    Post count: 19

    Stofan – so… i may have just figured this out for myself. in reading support posts and thinking through my own many load errors, I was under the impression that any CSV upload to update existing records would have to include all fields for the given record or existing data would be overwritten with blanks. I just tested loading one record with just gd_post, post_title, post_status, post_author, post_type, post_date, post_tags, post_category and default_category + the custom field I wanted to update. It seems like that loaded fine. What are the minimum fields that have to be included when updated an existing gd_place record? Ideally it would just be gd_post_id and the field(s) to be udpated. Will that work (haven’t tested yet). Thanks.

    #507340

    Naveen Giri
    Moderator
    Post count: 1559

    Hi Daniel,

    Yes, in order to update existing listing, ID and post_type column is must to have in .csv file and then the fields that you want to update.

    generally it will work, make sure to try it on staging first, just to avoid any possible issue.

    it may cause issue with connected custom fields.so we recommend to use all fields.

    Thanks

    #507494

    Daniel
    Expired Member
    Post count: 19

    Naveen – I am indeed able to make updates, just using ID and post_type, which is super helpful. Was that stated anywhere in the documentation? would have been good for me to know that a couple weeks back, i assume I missed it.

    Regarding my initial questions on the API, is there a general explanation of the features of the API? execution details are here https://wpgeodirectory.com/docs-v2/api/ but was wondering if there was a more basic explanation of what’s possible.

    Thanks

    #507798

    Naveen Giri
    Moderator
    Post count: 1559

    hi Daniel,

    as i already said partial import is not a recommended way for updating post.
    this hack not works for everyone.
    other needed details related to import provided here.
    https://wpgeodirectory.com/docs-v2/geodirectory/settings/import-export/

    about API, geodirectory API are similar to WordPress default apis.
    https://developer.wordpress.org/rest-api/reference/posts/
    they can be use to create delete update different listing posts.

    we will look to improve it by adding few examples, thanks for your suggestions.

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

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

Open Support Ticket