Back to Browse

CPS WebTips: Using JavaScript to Support More Complex Rules in Automate Evolve

187 views
Jun 15, 2023
8:42

What does Automate Evolve offer? -We are able to use the rule wizard to set fields values and requirements. With this, we can control the data entry on the forms and help guide the users to properly contribute values to the fields and continue throughout the workflow. -There can also be conditions set to rules to trigger them based on values or more complex conditions. This furthers the logic we can use on the form to show specific fields and groups to the user and better the user experience and workflow. Where can Automate Evolve improve? -The rule wizard alongside the conditions that can be set is very powerful and user friendly to do most tasks and logic-based actions. There are few circumstances where you set up a rule with conditions and the actions aren’t exactly what you are looking for. -This can entail either the rule not firing when you’d expect it, not firing at all, or firing when the condition is not met. We can bypass this issue by using custom rules with JavaScript. How can we continue to work with Automate Evolve using JavaScript? -The use of JavaScript might sound scary, but we will be using the least amount of code possible because of a great feature Evolve provides. -Every rule you create, you can view the JavaScript code it creates. This is very useful since we can do the bulk of the logic in the rule wizard and copy that code into the custom rule and finish the rest there. -By using a custom rule, we can ensure we are calling every field with the proper function call and then setting the rule to trigger on a button. We will be showing the following JavaScript example during this CPS WebTips: -In the solution, we have 3 checkboxes and a table with two columns. Column A in the table is editable though Column B is read-only. The user is required to select at least one checkbox and input either 1, 2, or 3 into Column A. They can add as many rows as they would like. When they submit, they will get another task. Depending on what checkboxes they selected, it will check the values in Column A and set the correlated cell in Column B to required. -The custom JavaScript rule is set on the JS Submit button. It pulls the JavaScript code from the rules on Column A and is set in a loop to check every row of Column A to run each rule code per cell. -Using this custom JavaScript rule method allows the user to set specific cells in a table to be required. Using regular rules will not fire and the user will submit the form before it can check for field requirements and notify the user. CPS has been tactically executing on implementations of digital transformation platforms for years focusing on business process automation, data & analytics and RPA. Our team would like to share this knowledge with you on our YouTube channel via CPS WebTips. Clear Process Solutions An SAP Optimization Company https://www.clearprocesssolutions.com/

Download

0 formats

No download links available.

CPS WebTips: Using JavaScript to Support More Complex Rules in Automate Evolve | NatokHD