Tag: business rules

[Video] Visual Rule Builder (V7.4)

vrbV7.4 has been released and it comes with a bunch of new things – the most exciting feature is the upgraded Visual Rule Builder.

Many customers use frevvo to create forms with extensive dynamic behavior. They love the flexibility and power of frevvo when it comes to creating dynamic forms. With frevvo’s Visual Rule Builder, it’s easier than ever to create these dynamic behaviors and anyone can do it.

Watch this short video that shows you how easy it is to use the Visual Rule Builder to create dynamic content.

Customers are using frevvo for things like:

  • Showing fields only when they’re relevant
  • Automatically filling in fields
  • Performing calculations

and many others.

View-Recording

Why not give it a whirl? Sign up for a free trial and see for yourself. It takes 30 seconds, and you can install a template and try it out instantly.

 

Visual Rule Builder Part 2: Subtotals and Totals

rules.jpgIn a previous article, we discussed how the Visual Rule Builder (VRB) update – it looks like it’s coming next weekend and we’re really excited – makes it super-simple to initialize forms with the current date, personal information etc.

Of course, real-world forms and workflows have many kinds of business requirements and another common one is the need to compute a subtotal and a grand total in a table of line items.

The form might look something like this. There’s a Table with four columns : Item description, Quantity, Unit Price and Subtotal. The Subtotal for each line is computed as the product of Quantity and Unit Price. There’s also a Grand Total which sums the individual line items.

Screen Shot 2017-12-05 at 1.58.35 PM.png

Prior to the VRB, you’d have to write a JavaScript rule as shown below

var tot = 0;
for (var i = 0; i < Quantity.value.length; i++) {
if (Quantity[i].value > 0 && UnitPrice[i].value > 0) {
var subtot = Quantity[i].value * UnitPrice[i].value;
Subtotal[i].value = subtot;
tot += subtot;
} else {
Subtotal[i].value = null;
}
}
GrandTotal.value = tot;

Once again, it’s not wildly complicated but there are a few quirks that could trip up someone who’s not used to coding e.g. a temporary variable is required to compute the Grand Total, there’s a for loop and the repeating fields need to be treated as arrays. The syntax can be a bit confusing, it’s easy enough to make a mistake and hard to debug.

Enter the Visual Rule Builder

With the VRB, it’s simple and anyone can do it. We’ll create two separate rules, one for the subtotals and another one for the Grand Total.

1. Open the VRB and set the condition. This is when we want the rule to fire. In this case, a Subtotal can only be calculated when we know the Quantity and Unit Price so that’s what we setup in the first panel of the VRB wizard.

Screen Shot 2017-12-05 at 2.34.50 PM.png

2. The next step is to define what actions to take when the condition is TRUE. Once again, with the VRB, it’s straightforward. We want to multiple Quantity and Unit Price.  So, we simply Set the Subtotal to the desired expression. We don’t have to worry about the fact that these are repeating fields in a table, there’s no for loop or array indexes to consider.

Screen Shot 2017-12-05 at 2.38.18 PM.png

3. Finally, in the last panel of the VRB wizard, we set the Subtotal to empty when the condition is FALSE. This ensures that the Subtotal will be cleared if Quantity or Price are empty.

Screen Shot 2017-12-05 at 2.39.47 PM.png

4. The last step is to calculate the Grand Total. Finish the above rule, create a new one and open the VRB. There is no Condition required so leave it empty. On the next panel we use a function to set the Grand Total to the Sum of all the Subtotals. That’s it. The SUM () function is smart enough to ignore empty rows and treats them as 0’s.

Screen Shot 2017-12-05 at 2.42.49 PM.png

5. The final rules look like this.

Screen Shot 2017-12-05 at 2.44.35 PM.png

6. Test the form. You’ll see that the Subtotals and Grand Total are automatically computed as desired.

Screen Shot 2017-12-05 at 2.47.17 PM.png

That’s it. Quick and easy – anyone can do it. This VRB update is coming really soon and we’re very excited about it because simplifying JavaScript rules has been a high-priority request from our customers. Contact us for more information and to try out the VRB for your own business forms.

Visual Rule Builder (VRB): Part 1

In recent articles, we’ve discussed how frevvo and other low-code platforms are making it easier for citizen developers who aren’t coders-by-trade to create effective, high-quality apps. Customers love the flexibility and power of frevvo when it comes to creating dynamic forms but, sometimes, they struggle with writing business rules in JavaScript.

We’re constantly working on improving our product to reduce the need to write code. We’re about to release an upgrade to the Visual Rule Builder (VRB) that’ll let you visually create even more dynamic behavior. Let’s take a look at an example. One of the most common business rules is to initialize a form with the current date and user data (first name, email address etc.) Until now, you had to write a rule like this:

if (form.load) {
TodayDate.value = frevvo.currentDate();
var ud = frevvo.userDetails();
UserId.value = ud.id;
FirstName.value = ud.firstName;
LastName.value = ud.lastName;
FullName.value = ud.name;
EmailAddress.value = ud.email;
ManagerId.value = ud.reportsTo;
}

It’s easy to make a mistake and hard to debug. In subsequent articles, we’ll see examples of even more complex rules.

Enter the Visual Rule Builder

Setting up your form for the above dynamic behavior is trivial with the VRB.  You simply use visual wizards. Let’s say, you’ve built a form with a few fields shown below. There’s a date field for Today’s Date and a Persona Info section with some user-specific data.

00-Date-Personal-Form.png

1. After you open the Rule Builder wizard, choose which field you want to Set from the pick list. The pick lists shows all available fields.

02-Choose-Field

2. What do you want to do? You can set a value, set a label, show/hide the control, enable/disable the control etc. In this example, we wish to initialize the controls and we’ll choose accordingly.

03-Choose-Operation

3. What do you want to set it to? You can use the slider to choose a literal value (e.g. 3 or the string “Joe”) or a function/expression. We’ll deal with expressions in a later post. In this case, we want to use built-in functions for today’s date and user-information. Start typing in the text box and matching functions will pop up. It’s very similar to Excel or Google Sheets. For each function, available parameters and detailed help is also displayed.

05-Choose-Function

4. When you’re done with all the fields in our form, it’ll look like this. We’re setting the TodayDate field to today’s date using the today() function and the various Personal Information fields to user-specific information using the appropriate userXXX() function.

06-All-Fields-Set

5. When you click Finish, the VRB wizard pops down and you can see a synopsis of the rule. Click any pencil icon to edit the rule and change the actions being taken.

07-Final-Rule

 

6. Test the form. You’ll see that all fields are automatically initialized as soon as the form loads to the appropriate values.

08-Test-Form.png

That’s it. Quick and easy – anyone can do it. This update to the VRB will be available in December 2017 (just a few days). Making JavaScript rules easier is one of the highest priority items for our customers and we’re excited about this capability. Subsequent posts in this series will explain other examples of rules that are much easier using the VRB.

V7.3 – SharePoint + other features …

We’re excited to announce that V7.3 is now available for Cloud customers. The on-premise version will be released approximately at the end of September. This release contains significant enhancements:

SharePoint Connector V1

sharepoint-workflow.pngYou can drag & drop using our intuitive browser-based form & workflow designers to create powerful business forms and approval workflows with all of frevvo’s advanced capabilities. Upgrade [not just replace] your InfoPath forms with frevvo’s advanced forms and workflows. Use point-and-click wizards to save your documents to a SharePoint library or to write data to a SharePoint list. It’s easy to try out online. Check out the short video demo of SharePoint workflows on our website.

Guided Tours and Page Help

guided-tour.pngIt’s easier than ever to try out a frevvo workflow. Simply sign up for a free 30-day trial account and you’ll be guided through installing a workflow template, trying it out and editing the workflow to make a simple change. Guided tours are also available for any workflow template. Context-sensitive help is available for many screens in the frevvo application. So, give it a whirl – it’s easy and takes just a few minutes.

Tons of Customer-requested fixes & enhancements

In addition, we’ve added many smaller new features. You can Test changes to a form or workflow without exiting the designer. It’s small but we’re thrilled about it – incredibly useful when you’re actually designing flows and want to test out a business rule change.

Step preconditions can be created visually using a wizard similar to the Visual Rule Builder, message controls limitations have been eliminated, the ComboBox control now connects directly to web services without the need for a JavaScript rule, and many other changes. You can read all about them in the Detailed Release Notes.

Interested in learning more. Sign up for a free trial on our website and try it out.

V7.3 – Dynamic pick lists & web services

One of the most common features our customers use is dynamic pick lists (or radio/checkbox controls). Examples abound such as a List of products for a Sales Order / PO, Number of available vacation days for a Leave Approval, List of projects for a Time Sheet and many others. With frevvo, you could always setup dynamic options using a business rule written in JavaScript.

/*member productCode, productName, resultSet*/
var x;
if (form.load) {
eval(‘x=’ + http.get(‘http://localhost:18080/database/BIRT/allProducts’));
var opts = [];
for (var i=0; i < x.resultSet.length; i++) {
if (x.resultSet[i]) {
opts[i] = x.resultSet[i].productCode + ‘=’ + x.resultSet[i].productName;
}
}
Products.options = opts;
}

V7.3 – no JavaScript

Products-WS
Selection Control connected to a web service

Starting with V7.3 (late August 2017), you can select an Options Source in the Properties pane for the selection control (drop down, radio or checkbox). By default, the Source is Design Time which simply means the choices are static and the designer specifies the list of options by typing them in at design time. But, you can now select Web Service. If you do that, three additional properties appear below:

 

  • Options URL: This is the end point for the web service. If you’re using the database connector,  it’ll be the same as the URL used in the JavaScript rule above. The assumption is that this call returns either XML or JSON.
  • Value binding: the path in the returned XML or JSON that determines the value of the select control (what’s in the submission).
  • Label binding: the path in the returned XML or JSON that determines the label of the select control (what the user sees).

That’s it. The URL can also be dynamic.

Edmunds
Selection control connected to the Edmunds API

For example, the screenshot at left shows a checkbox control that’s connected to the Edmunds API. The Options URL depends on the Year since that web service API returns Car Makes for a particular year. The URL is set to:

https://api.edmunds.com/api/vehicle/v2/makes?state=new&year={Year}&view=basic&fmt=json&api_key=<key hidden>

When the user types something in Year, the web service is automatically called, the results are refreshed and the choices in the Car Makes checkbox will change based on whatever the web service returned.

V7.3 will be released at the end of August. Visit our website and sign up for a free 30-day trial if you’d like to learn more or contact us for more information.

How To: Dynamic email addresses

A question we get asked frequently is how to send an email from a form or flow submission where the email address of the recipient is dynamically determined at runtime. For example, I have a drop down control and if the user selects HR, I want the email to go to the HR Department (hr@example.org) and if the user selects Finance, I want to send it to Finance (finance@example.org).

It’s very easy in frevvo.

1. Create a hidden Email control in your form.

AdminEmail

Drag & drop an Email control in your form. In the Properties panel, uncheck Visible so the control is hidden from the end user. Name the control Admin Email. We assume that you already have a drop down control (in the screenshot, it’s called Department and the choices are HR and Finance).

When the user selects HR from the Department drop down, we’ll set the Admin Email hidden control’s value using a business rule.

2. Set the Admin Email address using a business rule

Create a simple business rule.

if (Department.value == ‘HR’) {
AdminEmail.value = “hr@example.org”;
} else if (Department.value == ‘Finance’) {
AdminEmail.value = “finance@example.org”;
} else {
AdminEmail.value = null;
}

In frevvo’s Winter release (expected in late 2017), you’ll be able to create these type of rules visually with the Visual Rule Builder.

3. Use the Admin Email control in the To: email

AdminEmailWizard
Email Wizard that uses a control template

In any Email wizard, you can use the Admin Email hidden control for the To:, Reply to:, Cc: and other fields. In the above example, we’ve used it for the To: field.

That’s it. When the User selects HR, the rule will set the Admin Email control to hr@example.org. When the form is submitted, the Admin Email template in the To: field will be evaluated and will resolve to the value of the corresponding control (hr@example.org). The email will be sent to the dynamically resolved email address.

Announcing frevvo 7.2

form-workflowToday we’re happy to announce the general release of frevvo 7.2. Cloud customers were automatically upgraded on April 29. On-Premise availability is coming up shortly – subscribe to Release Announcements for the precise date. This release also includes upgrades to the Database Connector.

We know that frevvo is powerful software but there’s also a learning curve. frevvo 7.2 is the first in a series of updates this year focused on making it easier to use.

Visual Rule Builder

VRBTopDiagram3

One of the main areas customers tell us about is Rules. They’re really really powerful and many customers love the flexibility of being able to write JavaScript code and create very complex, dynamic behavior. But, they can be hard to use. Enter the Visual Rule Builder. Using it, you can create many rules visually rather than writing JavaScript. Read more in this blog article and find detailed documentation here. We’re excited about this new capability and expect improvements over multiple releases to make it easier and increasingly capable of replacing JavaScript-based rules.

This release also includes some security enhancements – e.g. user ids no longer appear in URLs and are replaced by opaque UUIDs – and other under-the-hood improvements needed for future ease-of-use improvements.

Database Connector

The DB Connector is one of the most widely used connectors – customers have created all kinds of integrations with their SQL databases. Most of the improvements made in this release are fairly technical and we won’t go into details here. See the Release Notes for reasons to upgrade. We’ve also made several under-the-hood improvements so we can make this oft-used connector easier to use and as point-and-click as possible. We’ll detail those in future blog posts.

We’re excited about this release and several upcoming ones. The focus is squarely on updating and making so many of the good things we do easier to use.

 

Visual Rule Builder: business rules without the JavaScript

I9-02.png
Federal I-9 in Designer

In recent articles, we’ve discussed how frevvo and other low-code platforms are making it easier for citizen developers who aren’t coders-by-trade to create effective, high-quality apps.

Here at frevvo, we’re constantly working on improving our product to reduce the need to write code. Our customers are organizations (companies, Universities etc.) that use frevvo for real-world business forms like Purchase Orders and Employee On-Boarding. These forms usually have dynamic behavior – in frevvo, that means business rules. One of the most common business rules is where you want to show or hide certain parts of the form (a Section or Tab or any control) depending on data that’s been entered into the form elsewhere.

Show/Hide Alien Authorization Numbers in Federal I-9

Let’s take a look at an example – an employee on-boarding workflow where the user has to fill in a Federal I-9. The Federal form asks for Eligibility Status and for one of those statuses – an alien authorized to work until a certain date – the employee has to provide additional information. In earlier versions of frevvo, you’d have to write a business rule in JavaScript. Something like:

if (CitizenStatus === ‘WorkAlien’) {
AlienNumbers.visible = true;
} else {
AlienNumbers.visible = false;
}

Seems simple enough but these JavaScript rules and their interactions with each other can quickly get very complex and difficult to understand. Dynamic behavior then becomes much harder for citizen developers to implement effectively.

Enter the Visual Rule Builder

When you create the above rule, you can use visual wizards as shown below:

rb-01
What’s the condition that causes this rule to fire?
rb-02
What action(s) should be taken when the condition is true?

rb-02b
[Optionally] What action(s) should be taken when the condition is false?
You can specify multiple conditions and a logic expression to evaluate them e.g. “A and (B or C)”. You can also specify multiple actions e.g. Show Alien Numbers AND Hide Citizen Information when the condition is true and vice versa when false. The Visual Rule Builder will generate a rule as shown below:

rb-03

If you need to edit the generated code, you can click Rule Code and make changes manually to the generated JavaScript. And, of course, the existing JavaScript-based rules continue to

um-01
Show/Hide Section

be available – some things are impossible to do using wizards e.g. connecting to an HTTP URL and parsing the result in specific ways.

When you run the form, it works as expected. Choose the appropriate option (alien authorized to work …) and the required Section shows up. For any other option, the Section in question is not visible exactly as desired. As with all frevvo forms and workflows, it’ll just work automatically on mobile devices.

Simple and easy. Now, of course, this is the first iteration of the Visual Rule Builder (it’ll be released shortly with V7.2) and it can currently generate a subset of rules. For the others, you’ll have to use the existing Rule Editor. However, like everything in frevvo, we’ll keep improving it with every version so your citizen developers will be able to do more and more with it.