Data updating

Closed

Pre purchase question Updated 2 years ago 11 Replies

Andrei asked 2 years ago on March 27, 2023 at 8:11 am

Hello there.
I want to use ImportWP for getting data from sports predictions XML feed.
In case of changing data in the XML feed (info about absences, injuries etc.) can plugin update this data in published posts?

J

James replied Support Agent

2 years ago on March 27, 2023 at 8:16 am

Hi Andrei,

ImportWP should allow you to fetch data from your xml feed and update posts with that data.

If you need anyhelp with extracting the data you need from the xml file let me know and i can help.

James

AP

Andrei replied

2 years ago on April 4, 2023 at 3:40 pm

Hi James,

I've bought ImportWP Pro and need you advice with the following:

1) I'm using sports predictions XML feed for getting data for Wordpress posts. When I add XML feed address into ImportWP Pro plugin and setup it for new posts creation - all works fine.
2) But if I change the data in XML feed (like post title, descriprion, content etc.) and setup the plugin for content updating (choosing only "Update - Allow updating of existing records" on step 4 "Permissions") - nothing happens with the content, it doesn't update.

J

James replied Support Agent

2 years ago on April 4, 2023 at 4:14 pm

Hi,

Are you manualy running the importer?

If so you need to go back to step "1. Select file" and click on download to fetch a new copy of the xml file.

The file should be downloaded automatically if you schedule the import.

James

AP

Andrei replied

2 years ago on April 18, 2023 at 9:06 am

Hi James!

Still fighting with the data updates :)

Steps:
1) I have an XML feed with 3 posts. They're successfully imported by Import WP PRO into WP and saved as drafts.

2) I change some data in XML feed (titles, subtitles, content etc.).

3) In Import WP PRO I select changed XML file on step "1. Select File", press "Download" or "Download & continue", ang get "New File added" message.

4) I go to step "4. Permissions" and choose "Update", then go to "5. Run inport" and choose "Run Now".

5) After pressing "Save & run" I get "Import complete, Errors: 3, Run Time: 00:00:00" message.

AP

Andrei replied

2 years ago on April 18, 2023 at 9:16 am

And if I choose both "Create" and "Update" options on step "4. Permissions" - I get both old and updated posts saved as drafts (3+3 drafts).
But I want just to update existing drafts in case XML file was changed.

J

James replied Support Agent

2 years ago on April 18, 2023 at 9:19 am

When you say you get "Errors: 3" , can you click on the history tab for that importer and view what the errors are?

J

James replied Support Agent

2 years ago on April 18, 2023 at 9:26 am

You mention that adding create and update permission, creates 3 new items, this suggests that you have not setup a unique identifier so that the importer knows how to identify if a record should be inserted or updated.

If you need help with this can you please export and attach your importer settings to this ticket by going to Tools > Import WP > Settings / Tools > Import / Export and select and export your importer as a JSON file.

AP

Andrei replied

2 years ago on April 18, 2023 at 9:29 am

AP

Andrei replied privately

2 years ago on April 18, 2023 at 9:32 am

J

James replied Support Agent

2 years ago on April 18, 2023 at 11:14 am

I have just tested this and it works as expected.

Can you confirm if you go to WP-Admin > Posts > All posts, and in the search for: "Boston Bruins vs Edmonton Oilers - Rogers Place - February 27, 2023", do you get any results?

You mention that you have ImportWP PRO, and looking at your xml feed i can see that there is an _id node, could this be used as a unique identifier, if so you can add the custom field as shown in the attached screenshots as a field named _ref_id and then set that field as the unique identifier on the permissions step? This will then keep track of the imported record using the id field, instead of the post title, so if the post title changes it will update the existing record and not insert a new one.

AP

Andrei replied

2 years ago on April 18, 2023 at 12:52 pm

Setting a field named _ref_id as the unique identifier helped: updating works for post titles and for post contents.

Thank you!