- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2022 11:59 PM
We are trying to publish our app in Servicenow appstore . As per the certification policy it is mentioned "Large scripts (larger than 500 lines) should be converted into script includes wherever possible."
Does this apply to Script Includes also? Can script include exceed 500 lines of code or does it need to be broken down into further script includes?
Thanks,
Sakshi Garg
"
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2022 12:18 AM
Hi
As per the best practices Business Rule (and other Server Side scripting components except Script Include) should be concise and should call Script Include if there are complex logic involved.
Script Include's script field has length = 4000 which does not mean that it will have 4000 characters. Refer the detail from ServiceNow KB article "Fields in ServiceNow accept string inputs greater than the sys_dictionary max_length value [KB068577..."
- Small (40) = varchar(40)
- Medium (100) = varchar(100)
- Large (1000) = mediumtext
- Extra Large (4000) = mediumtext
Any string field that is larger than varchar(255) is given the mediumtext data type. In the client, it will be represented as an HTML textarea, instead of an HTML input. The maximum length of mediumtext is 16,777,215 bytes.
So any code which is under 16MB can be accepted by ServiceNow which is a very big size for code. Considering performance, Script Include is called on demand and it will not put much load on the database unless you have exhausted the 16MB size.
Please mark my answer as correct if this solves your issues!
If it helped you in any way then please mark helpful!
Thanks and regards,
Kartik

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2022 12:08 AM
Hello,
No problem in keep more than 500 hundred lines in Script include, I see in my instance there are OOB code which have more than 500 lines
Please hit like and mark my response as correct if that helps
Regards
Regards,
Musab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2022 12:18 AM
Hi,
why not?
Even OOB script includes have more lines than 500.
You can always break it down but it causes more scripts to be maintained.
regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2022 12:18 AM
Hi
As per the best practices Business Rule (and other Server Side scripting components except Script Include) should be concise and should call Script Include if there are complex logic involved.
Script Include's script field has length = 4000 which does not mean that it will have 4000 characters. Refer the detail from ServiceNow KB article "Fields in ServiceNow accept string inputs greater than the sys_dictionary max_length value [KB068577..."
- Small (40) = varchar(40)
- Medium (100) = varchar(100)
- Large (1000) = mediumtext
- Extra Large (4000) = mediumtext
Any string field that is larger than varchar(255) is given the mediumtext data type. In the client, it will be represented as an HTML textarea, instead of an HTML input. The maximum length of mediumtext is 16,777,215 bytes.
So any code which is under 16MB can be accepted by ServiceNow which is a very big size for code. Considering performance, Script Include is called on demand and it will not put much load on the database unless you have exhausted the 16MB size.
Please mark my answer as correct if this solves your issues!
If it helped you in any way then please mark helpful!
Thanks and regards,
Kartik

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2023 03:33 AM
Hi @Kartik Sethi -- Is max. size for a script string not 32MB? See the dictionary below and also here. What do you think?