Creating a Phone Support Portal with the 3CX Call Flow Designer – Part 4

Introduction

The previous guides of this series Creating a Phone Support Portal with the 3CX Call Flow Designer – Part 1, Part 2 and Part 3, described how to create an application to validate a customer’s support contract info, and then transfer the call to the appropriate department. Part 1 described how to create the application call flow, Part 2 covered validating the information using a web service, and Part 3 validating using XML and CSV text files.

This guide presents validating using an SQL Server database, while the same steps can be applied for a PostgreSQL or MySQL database.

💡 Tip: The project for this example application is available via the CFD Demos GitHub page, and is installed along with the 3CX Call Flow Designer in your Windows user documents folder, i.e. “C:\Users\YourUsername\Documents\3CX Call Flow Designer Demos”.

Validating the Customer via a SQL Server Database

The 3CX Call Flow Designer offers out of the box integration with databases using the “Database Access” component. This component can be configured to access SQL Server, PostgreSQL  or MySQL databases. In this example, we use it to validate the customer by querying an SQL Server database:

  1. Drag a Database Access component from the toolbox and drop it into the designer.
  2. Rename the component to validateCustomer.

Database Access component configuration in 3CX CFD

  1. Assuming that a “Customers” table with “id” and “pin” fields exists, we can configure the component as in the above example.
  2. Note that the statement type is Scalar, i.e. the query returns a single value. In this case it returns the quantity of records with the specified id and pin. Consequently, if the value returned by the query is 0, the customer info cannot be validated, while if the value returned is 1 then validation was successful.
  3. We need to assign the validation result to the output property ValidationResult. We use an Assign a Variable component to set the value returned to the variable callflow$.ValidationResult, using this expression:

GREAT_THAN(validateCustomer.ScalarResult,0)

Example flow and component configuration in 3CX CFD

Consider the above example flow and component configuration.

Conclusion

This last guide of this series described validating customer info using a database, while the previous guides covered how to validate customer info via a web service, XML or CSV text files.

Now you have a clear picture on how to use most of the advanced components provided by the 3CX Call Flow Designer for performing different tasks.

See Also

Last Updated

This document was last updated on 29th April 2021

https://www.3cx.com/docs/cfd-creating-phone-support-portal-4/