Update Group
Updates properties of an existing group in Azure Active Directory.
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
If ContinueOnError property is true, no error is caught when the project is executed even if Catch node is used.
Inputs
- Access Id - The access ID from the Connect node. Optional if using direct credentials.
- Group Id - Group object ID of the group to update. Example:
12345678-1234-1234-1234-123456789012 - Update Properties (JSON) - A JSON object containing the properties to update. This is configured in the node editor with C# syntax.
Commonly Updated Properties
{
"description": "Updated group description",
"displayName": "New Group Name",
"mailNickname": "newgroupname"
}
Updatable Properties
description- Group descriptiondisplayName- Group display namemailNickname- Email nickname (for mail-enabled groups)
Some group properties cannot be updated after creation, such as groupTypes, mailEnabled, and securityEnabled.
Options
Direct Credentials (optional - alternative to using Connect node):
- Tenant Id - Azure AD tenant ID (optional if using Access ID)
- Client Id - Azure AD application client ID (optional if using Access ID)
- Client Secret - Azure AD application client secret credential (optional if using Access ID)
Output
- Result - Update result message, typically "Updated Successfully." if the operation succeeded.
How It Works
The Update Group node:
- Authenticates using either the access ID or direct credentials
- Sends a PATCH request to Microsoft Graph API with the update properties
- Azure AD updates only the specified properties
- Returns a success message
Examples
Update Group Description
Change a group's description:
// Using Connect node
access_id = message.access_id
group_object_id = "12345678-1234-1234-1234-123456789012"
// Update properties in node editor:
{
"description": "Updated description for engineering team"
}
// Output
result = "Updated Successfully."
Update Group Display Name
Rename a group:
group_object_id = "12345678-1234-1234-1234-123456789012"
// Update properties:
{
"displayName": "Engineering Department 2024"
}
Update Multiple Properties
Update several group properties at once:
group_object_id = "12345678-1234-1234-1234-123456789012"
// Update properties:
{
"displayName": "Marketing Team",
"description": "Marketing department collaboration group",
"mailNickname": "marketing-team"
}
Standardize Group Naming
Update groups to follow naming conventions:
// List All Groups node
// Update each group to follow convention
for (group of result.value) {
if (!group.displayName.includes("Department")) {
// Get Group node to get full details
// Group Object Id: group.id
new_name = result.displayName + " Department"
// Update Group node
// Group Id: group.id
// Properties:
{
"displayName": new_name
}
console.log("Updated: " + result.displayName + " -> " + new_name)
}
}
Bulk Group Description Updates
Update descriptions for multiple groups:
// Group updates
group_updates = [
{
id: "12345678-1234-1234-1234-123456789012",
description: "Sales team collaboration space"
},
{
id: "abcdef12-3456-7890-abcd-ef1234567890",
description: "Engineering team workspace"
}
]
// Process each update
for (update of group_updates) {
try {
// Update Group node
// Group Id: update.id
// Properties:
{
"description": update.description
}
console.log("Updated group: " + update.id)
// Delay between updates
// Wait 0.5 seconds
} catch (error) {
console.log("Failed to update: " + update.id)
}
}
Update Group by Name
Find and update a group by its display name:
// List All Groups node
// Find the group
target_group_name = "Old Team Name"
found_group = null
for (group of result.value) {
if (group.displayName === target_group_name) {
found_group = group
break
}
}
if (found_group) {
// Update Group node
// Group Id: found_group.id
// Properties:
{
"displayName": "New Team Name",
"description": "Updated team description"
}
console.log("Group updated")
} else {
console.log("Group not found")
}
Conditional Group Update
Update only if certain conditions are met:
group_object_id = "12345678-1234-1234-1234-123456789012"
// Get Group node first
// Group Object Id: group_object_id
// Check condition
if (result.description === null || result.description === "") {
// Update Group node
// Group Id: group_object_id
// Properties:
{
"description": "Default description for " + result.displayName
}
console.log("Added description to group")
}
Sync Group Information
Sync group data from external system:
// External system data
external_groups = [
{
azure_id: "12345678-1234-1234-1234-123456789012",
name: "Sales Team - West Region",
desc: "Sales team for western region"
}
]
// Update each group
for (ext_group of external_groups) {
// Update Group node
// Group Id: ext_group.azure_id
// Properties:
{
"displayName": ext_group.name,
"description": ext_group.desc
}
console.log("Synced: " + ext_group.name)
}
Tips for Effective Use
- Partial updates: Only include properties you want to change
- Validation: Validate data before updating
- Error handling: Use Try-Catch for bulk updates
- Logging: Log all update operations for audit trails
- Immutable properties: Can't change groupTypes, mailEnabled, securityEnabled
- Unique names: Ensure displayName and mailNickname are unique
- Bulk updates: Add delays to avoid throttling
- Verification: Get group details before updating
Common Errors and Solutions
"Group Object Id cannot be empty"
Cause: The Group Id input was not provided.
Solution: Provide a valid group object ID:
group_object_id = "12345678-1234-1234-1234-123456789012"
"Response Status is not OK - Group not found"
Cause: No group exists with the specified object ID.
Solution:
- Verify the group object ID is correct
- Use Get Group to verify group exists
"Property cannot be updated"
Cause: Attempted to update a read-only or immutable property.
Solution:
- Only update
description,displayName, andmailNickname - Cannot change
groupTypes,mailEnabled,securityEnabledafter creation - Create a new group if you need different group type settings
"Either Client Secret with Tenant ID and Client ID, or Access ID must be provided"
Cause: Neither access ID nor complete credentials were provided.
Solution:
// Option 1: Use Connect node
access_id = message.access_id
// Option 2: Provide all credentials
tenant_id = "your-tenant-id"
client_id = "your-client-id"
// Set Client Secret option from vault
"Display name already exists"
Cause: Another group already has the same display name.
Solution:
- Use a unique display name
- Check existing groups before updating
- Follow naming conventions to avoid conflicts
Best Practices
- Verify first: Get group information before updating to verify it exists
- Partial updates: Only update properties that need changing
- Validation: Validate all input data before updating
- Error handling: Always use Try-Catch for update operations
- Logging: Log all updates with timestamps and changed properties
- Bulk operations: Add delays between updates to avoid throttling
- Naming standards: Follow consistent naming conventions
- Audit trail: Maintain records of what was changed and when
- Testing: Test updates in development before production
- Immutability: Remember some properties can't be changed after creation
Related Nodes
- Connect - Establish Azure AD connection
- Get Group - Get current group data
- Create Group - Create new groups
- Delete Group - Delete groups
- List All Groups - Find groups to update
- List Group Members - View group members