Dynamic Groups Support

54 views
Skip to first unread message

Foresight Service

unread,
Oct 15, 2021, 4:13:45 PM10/15/21
to Foresight Community
Hi Foresight Team,

Thanks for creating this tool, it's been handy. One issue we're trying to solve for is the management of Org Unit memberships based on what dynamic Google Groups a user is a member of.

Our use case:
1. HR moves a user to a particular department
2. User's information is updated in Google
3. Google moves the user to a dynamic Google Group based on their user profile info
4. We would like to then trigger a move to a different Org Unit as well. This is where Foresight is not currently picking up the Google Group change. Is there a way to support dynamic group assignment alongside manual assignment in the Admin console?

Thanks!
-Scott
PartnerHero

Jason Huang

unread,
Oct 15, 2021, 8:40:35 PM10/15/21
to Foresight Community, Foresight Service
Hi Scott,

We have yet to support Google dynamic groups in Foresight. The dynamic groups is a relatively new concept.
Alternatively, Foresight supports a reversed use case
  1. HR changes a user's Org Unit to a particular OU
  2. It triggers Foresight to update the user's Department field
  3. Google moves the user to a dynamic Google Group based on their user profile info, including the updated Department field.
This use case can be completed by such automation User's organizational unit changed trigger => Update employee department action. Optionally, you can use an If action to set different department information based on different destination OUs, so that the automations can be simplified into one rule. 
screenshot_2021-10-15_17-36-59.jpg


Would this work too? 
Best,
--
Jason from xFanatical

Foresight Service

unread,
Oct 18, 2021, 3:57:59 PM10/18/21
to Foresight Community, Jason Huang, Foresight Service
Hi Jason,

That may be a good secondary solution for us, but ultimately our Google User fields are being populated from our HR database every 24 hours so driving things from the field updates is the ultimate solution. We'll try this out though.

Any plans to add support for dynamic Google Groups in the near future?

Jason Huang

unread,
Oct 18, 2021, 8:18:06 PM10/18/21
to Foresight Community, Foresight Service, Jason Huang
Hi Scott, it makes senses to integrate with HR database to fully automate the employee management. 
Sorry we don't have the plan to support dynamic Google Groups in the near future. But I'll add your feedback to our product backlog. 
Thank you.

Tacim BULUT

unread,
Feb 7, 2022, 3:07:51 AM2/7/22
to Foresight Community, Foresight Service, Jason Huang
Hi,
If you use the code below with the help of the apps script, you'll get it done. You can change the scenario according to you


function addAllOUUsersToGroup() {
let pageToken
let page
do {
page = AdminDirectory.Users.list({
domain: 'xxxxxx.com',
orderBy: 'givenName',
projection:'full',
//maxResults: 100,
pageToken: pageToken
});
var users = page.users;
if (users) {
for (var i = 0; i < users.length; i++) {
var user = users[i];

try {
var userEmail = user.primaryEmail
var groupEmail = 'grupx...@xxxx.com'; //Group to be added if conditions are true
var member = {
email: userEmail,
role: 'MEMBER'
};
department = user.organizations[0].department;
title = user.organizations[0].title;

if(department=='test1'&& title=='test5'){
Logger.log('%s,%s,%s)',user.name.fullName,user.locations,user.organizations, user.customSchemas);
member = AdminDirectory.Members.insert(member, groupEmail);
}

} catch (e) {
department = e
}
}
} else {
Logger.log('No users found.');
}
pageToken = page.nextPageToken;
} while (pageToken);
}

18 Ekim 2021 Pazartesi tarihinde saat 22:57:59 UTC+3 itibarıyla Foresight Service şunları yazdı:
Reply all
Reply to author
Forward
0 new messages