Unclear details of the import API, missing “replace all map data” option

New home Forums Pro Add-on General queries Unclear details of the import API, missing “replace all map data” option

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #58567
    mfoltin
    Member

    Hi there!

    I’m trying to create an “as automated as possible” way to perform mass marker imports, however only using already available plugin functionality (unfortunately not much time for any additional code extensions at the moment). I’m analyzing how the CSV import from Google Spreadsheet works and honestly I’m not quite sure how the import exactly works or how it is intended to work.

    Unfortunately I was not able to find much documentation regarding this topic – I only found the corresponding documentation page and the approx. 7min video – both describing only the basics…

    Basically what I’m trying to achieve is: I’d like to have one global marker source for all the maps (a google spreadsheet in this case, but I guess it does not matter where the CSV data comes from). In this source, I have unique marker id values in the “id” column and “map_id” column contains map ids as stated in the list of maps in the plugin UI. However when I import the source with “Use map ID’s specified in file” option checked, repeated imports always create additional entries, i.e. duplicates. So I’m kinda missing the “Replace map data” option in this case. I don’t want to use “Apply import data to” option, because that way I’d have to import marker data for evey map manually…

    Here’s a summary of several questions I’d like to ask:

    1. I’d like to import marker data from one source, but with several maps within the source, i.e. what the “Use map ID’s specified in file” option does, but with replacing all the data already present (i.e. deleting all the markers from all the maps before). Is that currently possible somehow please? (I have Version 8.0.10, incl. Pro addon)
    2. I’d be nice to have some documented description of all the csv columns, their valid values/value ranges and what they’re used for? (e.g. no idea what “did” or “other_data” are used for or what are the allowed values for many other columns – you only presented one simple example CSV file with few entries and all of them with the same value in most of the columns; no additional API explanation/documentation whatsoever… 🙁 )
    3. From my observations, I assume that any custom columns with names not recognized by the import process a are simply ignored, right? That’s a good thing actually, just making sure it’s an intended feature to ignore such columns (instead of cancelling the whole import) and that there’s no risk that this functionality might disappear in the future…

    I also studied the scheduling functionality a bit and found out that when there are several scheduled imports from various google spreadsheets URLs, then the scheduled imports overview gets quite “messy”, if you don’t remember which URL belongs to which map (which will be impossible in my case with expected maybe even 50+ maps in the future), since these URLs contain only generated keys, no human word descriptions. So here’s a small customization request/suggestion – please implement an additional “description” field on scheduled imports, in order to make the orientation in the scheduled import overview easier…

    Thanks a lot in advance for your feedback and keep up the good work!

    BR
    Martin Foltin

    #58587
    Perry
    Moderator

    Hi there

    Thank you for getting in touch, sorry to hear this hasn’t been a straightforward experience.

    Our importer examples can be found here https://www.wpgmaps.com/demo/marker-importer-demo/

    You can find the documentation here https://www.wpgmaps.com/documentation/exporting-and-importing-your-markers/

    1) Yes, this is possible, you can use “Use map ID’s” as well as “Replace map data”. If you’re not seeing those options together, please can we ask you to update. The current versions are 8.0.21 and Pro 8.0.25

    2) Most of these fields can be omitted, but to answer your question:

    id – The marker ID. This is ignored at present.
    map_id – The ID of the map this marker will appear on.
    address – The address, as a string, supports up to 700 characters.
    description – The description, as a string, supports up to 16,777,215 characters.
    pic – The markers picture, as a URL, supports up to 700 characters
    link – The markers link, as a URL, supports up to 2,083 characters
    lat – The latitude, in decimal format, this should be in the range -90 to +90
    lng – The longitude, in decimal format, this should be between -180 to +180
    icon – The markers icon, as a URL, supporting up to 700 characters
    anim – The marker animation, where 1 represents “Bounce” and 2 represents “Drop”. Any other value is interpreted as “None”
    title – The markers title as a string, up to 700 characters
    infoopen – The “infowindow starts open” setting for this marker, 1 represents “yes”, any other value represents “no”.
    category – Comma separated integers of category ID’s for the marker
    approved – The “display marker on front end” setting for this marker. Empty or 0 represents “no”, any other value represents “yes” (we recommend using 1)
    retina – Whether this marker is retina ready. Empty or 0 represents no, any other value represents yes. Please note this field is deprecated, and will be moved to “icon” as JSON.
    type – This field is redundant and deprecated
    did – The device ID field for Gold v4, and our legacy v1 tracking app. This field is deprecated and only necessary for legacy Gold / tracking app users.
    other_data – Storage for any arbitrary / user data on the marker, stored in a serialized format. For advanced users only. Most users can leave this blank, or omit the column.

    3) Any unrecognised columns are simply ignored. You can interact with our custom fields system, if you wish, by prefixing the column header with “Custom Field:” (no quotes), however to directly answer your question, you are correct to state that any unknown columns are simply ignored. I do not anticipate that this behaviour will change in the future at all, however, we may store any such data in other_data in the future. We certainly won’t introduce any breaking changes here.

    Regarding your final point, I will add this to our feature request list right now!

    Is there anything else we can help you with?

    Kind regards
    – Perry

    #58697
    mfoltin
    Member

    Hi Perry,

    sorry, I did not get the email notification and I just spotted your response few hours ago. I’m gonna try to upgrade the plugin and will let you know how it goes afterwards…

    Btw. I just noticed another thing – a small UI bug I’d say: when deleting a scheduled import within the Schedule overview, the schedule overview does not get updated automatically although the entry has been deleted succesfully.

    Thanks and will get back to you soon…

    BR
    Martin

    #58710
    Perry
    Moderator

    Hi there

    Thank you, we will log that on our fault tracker.

    We look forward to your response.

    Kind regards
    – Perry

    #58791
    mfoltin
    Member

    Hi Perry,

    thanks again for your reply! I tested it out, looks much better now.

    My current understanding is, that when I use map IDs defined in the source combined with “replace map data” option, the import process “touches” only those maps contained in the file, right? E.g. in the file I have several rows for map IDs 1 and 3, so it’ll first clear and then import data into maps 1 and 3, but it won’t touch the data in map ID 2, i.e. map 2 will keep its original marker data – is my understanding correct?

    thanks again and have a nice evening

    PS: If I may suggest… I’d recommend mentioning your response to my inquiry nr 2 (list of fields explaning their meanning and allowed values/value ranges) also in the documentation on the plugin page. Could save your time as well as time for your clients in the future 😉 (how else would I know what “did” means or that “id” column is always ignored…?)

    #58797
    Perry
    Moderator

    Hi James

    I’ve reviewed the CSV import code and can confirm that is indeed the case, only map ID’s present on the spreadsheet will be cleared.

    Thank you for your feedback, I’ll make sure we update this documentation as soon as possible, we are trying to remove the redundant code as soon as we can, it’s something we are actively engaged in.

    Is there anything else we can help you with?

    Kind regards
    – Perry

    #59146
    mfoltin
    Member

    Sorry for a delayed response, although I checked the corresponding option, for some reason I’m not getting any notifications for new reactions from this thread 🙁 I’m still working on the technical concept of my new project (bybike.to). Originally I wanted to use your plugin as the basis, but that’d mean it’d be absolutely 100% dependent on your plugin, so I’m still checking the overall technical feasibility and user-friendliness, since some points are still not quite intuitive (or maybe I just don’t understand them right). If anything new comes up, will either start a new thread or contact you directly. Thanks for now and have a nice day!

    #59155
    Perry
    Moderator

    Hi there

    Thank you for getting in touch, sorry to hear you’re experiencing issues.

    Please could you attach a screenshot of the options you are seeing?

    Kind regards
    – Perry

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.