Hey @Moedeb 

The key clarification is:

Logout is only required if your access is role-based (gs.hasRole)

If you move to group-based access (gs.getUser().isMemberOf), then logout is NOT required

 

1. Do you actually need logout?

Option 3 (Preferred): Avoid logout completely

Instead of relying on roles, use group-based checks

Replace role checks like:

gs.hasRole('your_role')

With:

gs.getUser().isMemberOf('your_group_name')

 

Where to apply this

  • ACL scripts

  • Business rules / Script Includes

  • UI logic where applicable

 

Why this works better

  1. Group membership is evaluated dynamically

  2. No dependency on session refresh

  3. No forced logout required

  4. More stable and scalable design

 

If you must keep role-based access

Then logout is unavoidable

This is because:

ServiceNow caches roles in the user session

They are not re-evaluated during an active session

 

In your case

Your 10-second wait is already correct

Your session kill approach is also correct

However:

Behavior can still vary due to browser/session caching

Which is why logout + redirect is typically required for consistency

 

2. What is actually needed (if using roles)

To make it reliable, you need:

  1. Role assignment completed (your wait handles this)

  2. Cache refreshed

  3. Session terminated

  4. Client-side logout/redirect (critical piece)

 

3. Redirecting user to Dashboard after Catalog Submit

Important

Flow Designer cannot handle redirects (server-side only)

Redirect must be handled on the client side

 

Service Portal 

Simple approach

function onSubmit() {

 setTimeout(function() {

    window.location.href = "/sp?id=your_dashboard_page";

 }, 3000);

}

 

More controlled approach

function onSubmit() {

 sessionStorage.setItem('redirect_after_submit', 'true');

}

Then in a widget or page script:

if (sessionStorage.getItem('redirect_after_submit') === 'true') {

 sessionStorage.removeItem('redirect_after_submit');

 window.location.href = "/sp?id=your_dashboard_page";

}

Classic UI (if applicable)

window.location = "/your_dashboard.do";

Final Recommendation

If possible - move to group-based access (no logout needed)

If roles must be used - your current Flow + session handling is correct, but you must add client-side redirect/logout

Handle all redirects in client layer, not Flow Designer

********************************************************************************************************************

If this response helps, please mark it as Accept as Solution and Helpful.

Doing so helps others in the community and encourages me to keep contributing.

Regards

Vaishali Singh





View solution in original post