Month: August 2017

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.

The benefits of automation

In March 2017 APQC surveyed organizations with high transactional volumes to understand the impact of automating the sales order entry process on performance and practices. The resulting infographic (below) shows how organizations that have adopted sales order automation have improved customer satisfaction, data capture for analytics purposes, and operational efficiency.

We’ve seen this ourselves at frevvo as we’ve automated our own internal approvals. It’s far easier and more efficient than managing them through email.

K08071_Benefits of automation

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.