FLOIP / flow-spec

7 stars 6 forks source link

Core.SetGroupMembership block: Allow to "clear" a contact from all groups (without having to explicitly list them). #63

Closed jcbalmeida closed 2 years ago

jcbalmeida commented 2 years ago

Problem: In some flows it may be interesting to "reset" the groups for the contact, however it is necessary to explicitly list the groups to which the contact belongs.

Proposal: Add the "clear" field to the block config, which, if present and true, removes the contact from all groups. When the "clear" field is present, the other fields will be ignored. Example:

{
  "type": "Core.SetGroupMembership",
  "name": "ClearContactGroups",
  "label": "Remove contact from all groups",
  "config": {
    "clear": true
  },
  "exits": [
    {
      "uuid": "6827500a-38b7-4dc3-803c-d2c14e961a0f",
      "name": "Default",
      "default": true
    }
  ]
}