It would be useful to have the action "remove items in list X from list Y".

This could for example be used if a node has a number of references in a node reference field, and you want to change them if they are no longer referenced. With this action, you could do "old references" minus "updated references", and then run updates on all the nodes that are no longer referenced.

Well, that wasn't really clear. Lucky for me that I will most likely be the one implementing this feature. :-)

Comments

itangalo’s picture

Changing title back. Damn spammer.

mitchell’s picture

Title: Differences between lists » Action: Differences between lists
Project: Rules Bonus Pack » Rules
Version: 7.x-1.x-dev » 7.x-2.x-dev
Component: Rules Bonus: Miscellaneous » Rules Engine

This could be added to Rules. Maybe in #1540634: Calculate a value: support strings, lists, & files?

mitchell’s picture

Component: Rules Engine » Rules Core
StatusFileSize
new719 bytes
new2.34 KB

I'm pretty sure you and fago, #1391840: Action: "Filter list items" based upon any condition(s), are talking about a new action, but it would also (conceivably) be possible to include a component built on list_contains in a loop to construct the desired output.

This was a simple try at getting that logic working with "Remove the list of letters in list2 from the list of letters in list1", but I didn't nail it yet.

Thoughts?