@simon Coming back to this because we need to have multiple groups added/removed and it seems to only be apply the last group. Essentially I changed the code to check for multiple different memberships (similar to Dani1’s code above). It works except when someone is a member of multiple memberships. In that situation it only applies the last group, which makes sense since it is looking for the latest value of $params. Is there a way to have multiple checks without having to nest conditions, which could start to get pretty messy?