How to Extend the Export Limit for Users with Particular Roles?

Prutha Joshi
Mega Guru

How to configure a code/functionality where we can extend the Export to .xls limit as per the role of the logged-in User? 
Extending Export limit from properties can result into the performance issues & will be applicable to all the users.

The Requirement is - If the limited number of users who would need the report of the data with more than 20-50 K data , can we extend the limit of the export for such users ? 

is there any possible way?

(as of now not able to change the export limit for particular users)

Please share views.

1 ACCEPTED SOLUTION

Punit S
Giga Guru

Hi Prutha, 

Very interesting question and very applicable to most of the customers. Yes, it is possible to extend the export limit for specific users or in a bulk way in ServiceNow based on their roles. To achieve this, you can use a combination of access controls, business rules, and scripts.

Here are the general steps you can follow to achieve this:

  1. Define a new role: Create a new role in ServiceNow for the users who require an extended export limit. For example, you can create a role called "Extended Export Users".

  2. Create an access control: Create an access control that limits the export limit for all roles except the "Extended Export Users" role. To do this, navigate to "System Security" -> "Access Control" -> "Create New". Name the access control, set the "Applies To" field to "Export to Excel", and set the "Roles" field to "Not Equals to" and then select the "Extended Export Users" role.

  3. Create a business rule: Create a business rule that runs when a user logs in and checks if the user belongs to the "Extended Export Users" role. If the user belongs to this role, then the business rule can set a system property to increase the export limit for that user. To do this, navigate to "System Definition" -> "Business Rules" -> "Create New". Name the business rule and set the "When to run" field to "Before". In the "Advanced" section, write a script that checks if the logged-in user belongs to the "Extended Export Users" role, and if so, sets the system property for the increased export limit.

  4. Create a script include: Create a script include that contains the code to implement the increased export limit. In the script include, write a function that checks if the current user belongs to the "Extended Export Users" role and if so, returns the increased export limit. Otherwise, return the default export limit. Then, in the business rule created in step 3, call this function to set the export limit for the user.

By following these steps, you can extend the export limit for specific users based on their roles, without impacting the performance of the system or affecting other users.

 

Please mark my answer correct/helpful in case it adds value and moves you a step closer to your desired ServiceNow solution goal. 

Thanks,
Punit

View solution in original post

3 REPLIES 3

Punit S
Giga Guru

Hi Prutha, 

Very interesting question and very applicable to most of the customers. Yes, it is possible to extend the export limit for specific users or in a bulk way in ServiceNow based on their roles. To achieve this, you can use a combination of access controls, business rules, and scripts.

Here are the general steps you can follow to achieve this:

  1. Define a new role: Create a new role in ServiceNow for the users who require an extended export limit. For example, you can create a role called "Extended Export Users".

  2. Create an access control: Create an access control that limits the export limit for all roles except the "Extended Export Users" role. To do this, navigate to "System Security" -> "Access Control" -> "Create New". Name the access control, set the "Applies To" field to "Export to Excel", and set the "Roles" field to "Not Equals to" and then select the "Extended Export Users" role.

  3. Create a business rule: Create a business rule that runs when a user logs in and checks if the user belongs to the "Extended Export Users" role. If the user belongs to this role, then the business rule can set a system property to increase the export limit for that user. To do this, navigate to "System Definition" -> "Business Rules" -> "Create New". Name the business rule and set the "When to run" field to "Before". In the "Advanced" section, write a script that checks if the logged-in user belongs to the "Extended Export Users" role, and if so, sets the system property for the increased export limit.

  4. Create a script include: Create a script include that contains the code to implement the increased export limit. In the script include, write a function that checks if the current user belongs to the "Extended Export Users" role and if so, returns the increased export limit. Otherwise, return the default export limit. Then, in the business rule created in step 3, call this function to set the export limit for the user.

By following these steps, you can extend the export limit for specific users based on their roles, without impacting the performance of the system or affecting other users.

 

Please mark my answer correct/helpful in case it adds value and moves you a step closer to your desired ServiceNow solution goal. 

Thanks,
Punit

Hi.  This is a really good article but I need a little bit more detailed information.  Should there be another sys_property that has an extended export limit?  Can you go into more detail/guidance on creating steps 2,3, and 4, please?  Thank you.

 

This is exactly what I'm looking for!!!

 

Prutha Joshi
Mega Guru

Thank You Punit for the detailed approach.