How to increase the length of condition in workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2024 08:30 AM
Hi All,
I am having a workflow , using a branch activity.
Branch contains 4 conditions. I want the condition length of branch to be increased as I am having multiple conditions to get it filled in
Please let me know how can I increase the length of branch condition.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2024 09:21 AM
Hi @Priyanka145 ,
For easier maintainability, keep the condition as short as possible. If the computation is complex, it is difficult to read and understand. Rather than increasing the field length, consider putting your logic in a script include. For example, rather than something like this...
current.active && current.canRead() && (current.state == 4 || current.state == 5 || current.state == 7) && (current.u_requester.department.getDisplayValue == 'Marketing' || current.u_requester.getDisplayValue() == 'HR') || gs.hasRole('admin')
It could look something like this:
new myConditionCheck().ApprovalUIAction(current);
and your script include becomes a thing of beauty to maintain and extend.
This is the recommendation from @Chuck Tomasi : https://www.servicenow.com/community/developer-forum/increase-the-max-length-hof-condition-in-ui-act...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2024 09:32 AM
Hi @Priyanka145.
As Sandeep mentioned, you need to write conditions in Script Include and you need to call it in condition field.
Thanks,
Sagar Pagar