How to add action that will check if user is inactive for 60 days?

jeffreygard1127
Tera Contributor

Hi everyone!

 

Good day!

 

It's my 1st time to create a flow design from scratch and I need help cause I can't execute the logic. 
I need to create a flow that will trigger the deactivation tasks for (2) department. Each dept has their own deactivation tasks and we already have the subflow for it. But these subflow will only be triggered after checking in the sys_user table that users are already inactive for 60 days.
REQ.png

I know how to do the trigger, but I don't know how to do the ACTION part, can someone please help me?
Terminate Flow.png

9 REPLIES 9

Runjay Patel
Giga Sage

Hi @jeffreygard1127 ,

 

As suggested by @Ankur Bawiskar  you need to add that filter to target the correct user record.

Now you need to call sub flow for 2 department.

 

RunjayPatel_0-1737993126132.png

 

-------------------------------------------------------------------------

If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.


Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay

-------------------------------------------------------------------------

 

Hi @Runjay Patel, good day! Appreciate your response on my question. However, I'm confused on why on his filter, it says ACTIVE is true? Can you elaborate on this?

Also, I had to change my initial trigger from ACTIVE is FALSE to ACTIVE CHANGES TO FALSE because this flow should only run once the system detected that a user becomes INACTIVE, is this correct?

Terminate Flow 2.png

Your trigger condition is correct.

 

Ankur's filter will give list of users who are active but has not logged into Servicenow for last 60 days.


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP

Hi @Voona Rohila thanks for responding but I'm confused. So what we need is for this flow to ONLY run once a user changes from ACTIVE to INACTIVE. 2nd, once we have identified those users that becomes inactive, we need to wait for 60 days and check again if they are still active. If after 60 days and they becomes active, the flow should end. But if after 60 days and they remain inactive, the flow will continue. Sorry, I'm new to creating flow design.

Hi @jeffreygard1127 ,

 

Sorry for confusion, follow below steps.

1. Setup trigger condition like below.

RunjayPatel_0-1738036619212.png

 

2. Add below flow logic with 1440 hours

RunjayPatel_1-1738036814260.png

RunjayPatel_2-1738036857384.png

 

3. Add you subflow.

RunjayPatel_3-1738036937492.png

 

 

-------------------------------------------------------------------------

If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.


Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay

-------------------------------------------------------------------------