Approval Request for multiple users with Single Approval Record

Namita_Snow
Tera Expert

Hello community,

 

We have requirement where from single request, user can raise a bulk user access request for multiple domains, but each domain owner has to receive single approval request for bulk users. For example, if a user selects 5 users to get access to 3 different domains, there will be 3 approvals, where each domain owner can decide whom to approve or reject out of the 5 users. They should have the capability to approve all users or reject a few.

 

If anyone has any insights on how we can implement this, please let me know.

 

Thank you in advance!

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

@Namita_Snow 

so what did you think of and where are you stuck with the approach

how is your catalog form designer? approach will be decided based on that

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

Murtaza Saify
Tera Contributor

1. Create a Custom Table for Domain-User Mapping

  • Create a custom table (e.g., x_123456_bulk_access_domain_users) to store the mapping of domains and users for each request.

    • Fields:

      • Request (Reference to the main request)

      • Domain (Reference to the domain)

      • Users (List of users for the domain)

      • Approval Status (e.g., Pending, Approved, Rejected)

2. Update the Request Form

  • Add fields to the request form:

    • Users: A list collector or reference field to select multiple users.

    • Domains: A list collector or reference field to select multiple domains.

  • On submission of the request, use a Business Rule or Script Include to:

    • Create child records in the custom table (x_123456_bulk_access_domain_users) for each domain.

    • Populate the Users field with the selected users for each domain.

3. Generate Approval Tasks for Each Domain Owner

  • Use a Flow, Workflow, or Script to:

    • Query the custom table for all domains in the request.

    • For each domain, create an approval task (e.g., Approval [sysapproval_approver] record).

    • Link the approval task to the child record for the domain.

    • Assign the approval task to the respective domain owner.

4. Build the Approval Form

  • Customize the approval form to display:

    • The list of users for the domain.

    • Checkboxes or options for the domain owner to approve or reject individual users.

  • Use a Client Script or UI Policy to:

    • Allow the domain owner to select which users to approve or reject.

    • Update the Approval Status field in the child record based on the selections.

5. Approval Logic

  • When the domain owner submits the approval:

    • Update the Approval Status field in the child record for each user.

    • If all users for a domain are rejected, mark the domain as fully rejected.

    • If at least one user is approved, mark the domain as partially approved.

6. Consolidate Results

  • Use a Business Rule or Script to:

    • Check the status of all child records for the request.

    • If all domain approvals are complete, update the main request status (e.g., "Approved", "Partially Approved", or "Rejected").