schedule job to remove user after 24hrs from a particular group

Ajith A Pillai
Tera Contributor

Hi All,

I wanted to create a schedule job which runs daily to remove users from a particular group.

For e.g.: If user raise a request for group access, post approvals, user was added automatically into the group. This was achieved through flow designer. 

Now I want to remove the same user from the same group after 24hrs through automatically.

Anyone worked on this, please help me with the steps or scripts.

 

Regards,

Ajith

1 ACCEPTED SOLUTION

Hayo Lubbers
Kilo Sage

 

You can use the 'Wait' option from the Flow Logic to wait for a desired amount of time, before continuing in the same flow with removing the user.

HayoLubbers_1-1721828954255.png

 

Regards,

Hayo

 

--EDIT--

Have a look at the time limited roles, maybe it suites your needs:

https://www.servicenow.com/community/now-platform-articles/requesting-time-limited-user-roles-for-ot...

View solution in original post

2 REPLIES 2

Slava Savitsky
Giga Sage

In your flow, use eventQueueScheduled API to schedule an event for a specific time in the future and have a Script Action react to it and remove the user from the group.

Hayo Lubbers
Kilo Sage

 

You can use the 'Wait' option from the Flow Logic to wait for a desired amount of time, before continuing in the same flow with removing the user.

HayoLubbers_1-1721828954255.png

 

Regards,

Hayo

 

--EDIT--

Have a look at the time limited roles, maybe it suites your needs:

https://www.servicenow.com/community/now-platform-articles/requesting-time-limited-user-roles-for-ot...