When a user doesn't login for 60 days remove him from groups with ITIL role only using Flow Designer

Susmitha1625
Tera Guru

Hello All,

 

I've a request to remove a user from the groups with ITIL role if he doesn't login for 60 days by only using Flow Designer. Please help me with the design flow. Thanks in Advance.

1 ACCEPTED SOLUTION

@Susmitha1625 

I hope this helps

flow user not login.gif

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

14 REPLIES 14

palanikumar
Mega Sage

Hi,

Follow the below steps:

1) Create a flow with trigger as Daily and set time as time when you want to run this flow (suggest early hours like 1:00 AM

2) Inside flow create lookup record and select table as sys_user and condition as "last login" before "last 30 days)

3) Create for each loop and select the output of previous step

4) Create a script and check all the groups where user is member of (sys_user_grmember table) and then check whether this table has ITIL access, if yes then delete the record.

 

Let me know if you need more detail 

Thank you,
Palani

Susmitha1625
Tera Guru

I basically need help to create the script in script action

Ankur Bawiskar
Tera Patron
Tera Patron

@Susmitha1625 

Palanikumar has already shared the steps. where are you stuck or what did you start with?

This link has solution with screenshots. please update it for 60 days

Remove User Group Roles if not logged in last 35 Days - Using Only Flow Designer 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Susmitha1625
Tera Guru

Hi @Ankur Bawiskar 

I want to remove the user from all the groups that has ITIL role and add him to a group with a Non-ITIL group. I've worked till the logic already from creating Schedule trigger to getting the user from sys_user_grmember table. I'm stuck at getting the groups with 'ITIL' role from the list of the user's groups from grmember table.