Groups (Community)

Last Updated: 2021-02-11

Once you have an App, Source, and Properties (start with an App if you don't have any), then you're ready to define your Groups.

Groups are where the magic happens in Grouparoo. (It's in the name, after all!) Groups are a segment or cohort of Profiles. They are useful in that you can use Groups to target a specific set of users to export to some Destination. You can have Calculated Groups and Manual Groups. See here to learn more about the core concepts in Grouparoo.

Generating a Calculated Group

To generate a new Calculated Group for your Grouparoo application, run the generate command.

grouparoo generate group:calculated all_emails

Note here that all_emails is the ID for the Group. An ID is always required when generating a config object.

This command will generate a file in your application directory at config/groups/all_emails.js that looks something like this:

exports.default = async function buildConfig() {
  return [
    {
      class: "group",
      id: "all_emails",
      name: "all_emails",
      type: "calculated",
      rules: [],
    },
  ];
};

More info this below.

Configuring Your Calculated Group

Configuring a Calculated Group is all about adding Rules to the group. A Rule is some logical operator to filter Properties. A profile must match every Rule to be included in the Group.

Available operations depends on both the type of Property and the underlying Grouparoo database (SQLite vs. Postgres). See below for a list of rules. (If in doubt, choose Postgres.)

The following operators are available on boolean properties:

OperatorDescription
existsexists with any value
notExistsdoes not exist
eqis equal to
neis not equal to

The following operators are available on date properties:

OperatorDescription
existsexists with any value
notExistsdoes not exist
eqis equal to
neis not equal to
gtis after
ltis before
gteis on or after
lteis on or before
relative_gtis in the past
relative_ltis in the future

The following operators are available on email properties:

OperatorDescription
existsexists with any value
notExistsdoes not exist
eqis equal to
neis not equal to
likeis like (case sensitive)
notLikeis not like (case sensitive)
startsWithstarts with
endsWithends with
substringincludes the string
iLikeis like (case insensitive)
notILikeis not like (case insensitive)

The following operators are available on float properties:

OperatorDescription
existsexists with any value
notExistsdoes not exist
eqis equal to
neis not equal to
gtis greater than
ltis less than
gteis greater than or equal to
lteis less than or equal to

The following operators are available on integer properties:

OperatorDescription
existsexists with any value
notExistsdoes not exist
eqis equal to
neis not equal to
gtis greater than
ltis less than
gteis greater than or equal to
lteis less than or equal to

The following operators are available on phoneNumber properties:

OperatorDescription
existsexists with any value
notExistsdoes not exist
eqis equal to
neis not equal to
likeis like (case sensitive)
notLikeis not like (case sensitive)
startsWithstarts with
endsWithends with
substringincludes the string
iLikeis like (case insensitive)
notILikeis not like (case insensitive)

The following operators are available on string properties:

OperatorDescription
existsexists with any value
notExistsdoes not exist
eqis equal to
neis not equal to
likeis like (case sensitive)
notLikeis not like (case sensitive)
startsWithstarts with
endsWithends with
substringincludes the string
iLikeis like (case insensitive)
notILikeis not like (case insensitive)

The following operators are available on url properties:

OperatorDescription
existsexists with any value
notExistsdoes not exist
eqis equal to
neis not equal to
likeis like (case sensitive)
notLikeis not like (case sensitive)
startsWithstarts with
endsWithends with
substringincludes the string
iLikeis like (case insensitive)
notILikeis not like (case insensitive)

Add your list of Rules to the rules array in the generated config file. You may also change any of the other default values, as necessary.

Adding Manual Groups

While a great deal of the value of Grouparoo comes from our Calculated Groups, Manual Groups are still valuable in certain circumstances. Manual Groups are Groups of profiles where you manually add or remove Profiles from the Group.

To generate a new Manual Group for your Grouparoo application, run the generate command.

grouparoo generate group:manual my_custom_group

Note here that my_custom_group is the ID for the Group. An ID is always required when generating a config object.

This command will generate a file in your application directory at config/groups/my_custom_group.js. You can change the name and id properties in this file.

Validating & Applying Your Config

You can validate your config at any time using the validate command:

grouparoo validate

And you can apply that config (save it to your Grouparoo application's database) using the apply command:

grouparoo apply

Note that apply will run validate, but it's recommended to run validate on its own first, just to be safe.