1

I'm stuck with a simple problem, maybe someone can point me in the right direction...

I have a ContentType with a field, let's say it's a list of hobbies. It's a Checkboxlist, multi-select.

Users have an additional account field to select their favourite hobby (a single-select selectbox)...

Now, when a new content of that type is generated I wan't to send an email to all users who have a selected hobby from the list, selected as favourite in their profile.

--

I used "Fetch entity by property" to get the users with one of the selected hobbies.

I configured it that way:

  • Entity type - Value: User
  • Property - Value: Hobby (this is a single value, cause a user can only select one hobby)
  • Value - Data selector: node:hobbies:0 (and there is the problem: I can only compare it with the first value of the multi-select hobbies list)

Result: It triggers only correctly for the first selected hobby.

--

How can I configure it to take every selected value?

1

There is a switch to direct input mode button in the Value - Data selector section, after clicking it you'll see a select box with all the values of that field which now you can select.

0

Your Rules Events and Conditions (if any) are pretty sure OK, but you're missing a crucial Rules Action: a Rules Loop. If you're not familiar with such loops, then I strongly recommend to have a look at the tutorial titled "Lists and loops".

In your case, you should add a loop related to that list of hobbies entered when a content type is added. After you do, you should iterate over each item in that list (= each hobby in the content type added). And for each iteration you should then perform the Rules Actions you seem to have in place already (ie "Fetch entity by Property", etc). If you rework your rule like this, in the end you should replace that node:hobbies:0 by the "list item being processed" (ie the hobby, selected in the node, being processed in the current iteration step).

Easy, no?

PS: I doubt the prior answer is going to help achieve your goal ...

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.