Don't import a field if tag is not present

Closed
ImportWP Pro - WordPress XML & CSV Importer ImportWP Pro - WordPress XML & CSV Importer May 04, 2021
Login to reply
Marco PIERRARD
3 years ago

Hello,

I just tested on my side and it works perfectly.

Thanks again for your great support.

Regards

James Collings Support Agent
3 years ago

Hi Marco,

Sorry i am in the process of refreshing the website and documentation, with all the latest importer changes, so the documentation is pretty poor at the moment, hopefully not for to much longer.

I have just tested and confirmed that acf fields will be in the format:

custom_fields.acf_field::text::field_6092974075a1c

Which is just the field name when you select enable text field, prefixed with custom_fields. which is the section id.

I am hoping in the future to upgrade this field text input with a UI

Marco PIERRARD
3 years ago

Hello,

Thank you for this updated code, it works great .

I have another issue concerning the permissions with the update option.
I'm using the "None of the following Fields" option to remove certain fields of the update processus.

It's working fine with the title of the item (post_title) field but I want to do the same with an ACF field and it's updated anyway.

I've try to put field_5e62a6776df14 (see screenshot) but it doesn't work.
I've tried acf_field::text::field_5e62a6776df14 too but it's not working neither.

How should the field should be written to skip from the update?

Thank you

Regards

James Collings Support Agent
3 years ago

Hi Marco,

I have updated the the ignore empty fields function in the attached version which should take into account if tags are not present.

James

Marco PIERRARD
3 years ago

Hello,

I have an import scheduled daily that import data from an xml file into ten fields (regular Wordpress and ACF fields). I have a problem with one of this field (it's the price of the book) when an item (so a book in my case, it's a custom post) already have data in the fields and i'm updating it.

With your help (thanks again) I have a bit of code that don't import the data if there is nothing in the tag related to price. Like that I don't remplace a price already in the field with nothing.

But now I got a new issue. The files I get everyday don't always have all the tags in it. Sometimes they don't have the price tag and when I'm importing it, the field "price" is reset to nothing if data is already in.
Perhaps I will have the same problem with other fields.

So my question is that : when there is nothing in a tag the data is not imported to be updated but is it possible to do the same thingwhen the tag is not present at all?

Thank you

Regards