0

Importing new entities with feeds using a published csv file is very handy. I use Google Sheets to publish a csv file and use Feeds to create new nodes, which then can be updated based on a unique target field.

However, I have a number of sites that need their content to be bulk-updated in a similar fashion, but these entities were not imported through Feeds, so no unique target / hash check is present to update them.

Is there a way to make drupal import a feed and check for existing entities using the title field, and modify/populate the corresponding fields?

1
  • 1
    It sounds to me like you need to use Rules and re-enigeer building a unique hash of the existing data for Feeds to then use in it's check to insert or update data.
    – tenken
    Apr 14, 2016 at 15:32

1 Answer 1

1

You could use a custom text field as unique target by using the "Unique values" validator of the Field validation module.

You could also implement hook_feeds_processor_targets_alter() in a custom module to add a "unique callback" to a target. In that callback you can implement your own logic for retrieving an existing entity.

See https://www.drupal.org/node/1307732#field_as_unique_id_7 for a list of steps for both solutions. See also feeds.api.php for more information about implementing "unique" callbacks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.