Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

Using Feeds, Drupal creates automatically a Rule "before saving a content imported by feeds".

In my XML file I've got a unlimited value field that goes into one unlimited value field in my content type and I would like to create a rule that populates another field in my content type with one specific term grabbed from the XML field.

i.e One item in the XML file has got terms:

Fruit, Sicily, Oranges

Another item has got other terms:

Nut, Sicily, Chestnuts

From here I need to grab just Fruit or Nuts.

So I've created two Rules:

The first one checks if the field contains the term Fruit.

  1. Event: Before Saving a node from xml feed
  2. Condition: Data comparision TRUE with term ID of Fruit.
  3. Action: Here I would like to grab Fruit.

The second Rules is similar to the first one, but it checks if it contains Nut.

I've tried to set the Action with Set data value -> Target field node:field-type:Taxonomy(Name) -> Set a fixed value. It does not work.

I would like to know how to set the Action. If it's not possible using Rules, how do I achieve this aim?

Thanks in advance.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Solution

Rules

  1. Before saving a node from xml feeds
  2. Data comparision TRUE with rem id Fruit
  3. Set data value -> node:field-taxonomy-type -> click on "Switch to direct mode input" and it will show the terms for that Vocabulary.
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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