Used to search within user groups and to add new groups.

Hierarchy

  • UserGroups

Methods

create

  • The method creates a new user group.

    To save a group, use the UserGroupItem.save method:

    const newGroup = System.userGroups.create();
    newGroup.data.__name =  'Managers'; 
    await newGroup.save(); 
    

    If the required field __nameis not filled, the script will return an error of the following type: Error: field /__name is required;

    Returns UserGroupItem

search

  • The method is used to search for user groups.

    To search for items in the collection, use the Search object:

    const groups = await System.userGroups.search()
        .where(f =>  f.isRole.eq(true)) 
        .all(); 
    

    Read more about using search in the Manage apps article.

    Returns UserGroupSearch