Chapter 2 - Adding Central Flows to a form
This chapter turns an ordinary form template into a Central Flows form. You add the Central Flows XTP in FormsDesigner, connect it to qRules, choose where the form is submitted, and adjust e-mail, buttons, session timeout and Authy. The server side (Chapter 1) must be in place first.
The XTP also inserts an instruction section at the bottom of the form with these same steps. This chapter follows that section and adds where to click in FormsDesigner; delete the instruction section when you are done (section 2.13).
Most steps change rules in the XTP's own data source, v2_XtpLogic_CentralFlows. To edit one: in the Data Fields pane switch the data source to v2_XtpLogic_CentralFlows (Secondary), expand to the node named in the step, select it and click Rules.
2.1 Add the XTP
- Upload your form template to FormsViewer and click Design to open it in FormsDesigner.
- Click at the very bottom of the form canvas, outside any section or table.
- In the ribbon open Add XTP, choose Central Flows, and click +.
- The XTP adds its data sources, rules, view elements and resource files. The template is now Central Flows-enabled.
2.2 Add qRules
Central Flows runs on qRules. If the qRules ribbon tab does not say "This form already has qRules!", add qRules from that tab.
2.3 Set the form title
In the section the XTP inserted, replace the text My FormName with the title users should see.
2.4 Start the XTP when the form opens
- Switch the data source to QdabraRules (Secondary), select finishedLoading and click Rules.
- Add a rule and move it to the top of the list, so it runs first.
- Add the action Set a field value: field
XtpLogic/Actions/RunOnLoadin v2_XtpLogic_CentralFlows, valuego.
finishedLoading is the first trigger that runs rules when a form opens (see the FormsDesigner User Manual, section 1.6.1).
2.5 Connect the XTP to qRules
The XTP sends its qRules commands through temporary fields, which you point at the real QdabraRules fields once:
- In v2_XtpLogic_CentralFlows, select
XtpLogic/qRulesTemp/tempCommandand open the rule *Set qRules. - First action: change the field it sets from
@stopto QdabraRules > Command. - Second action: change the placeholder value to QdabraRules > Result.
- Do the same for the next actions: tempSuccess to QdabraRules > Success and tempError to QdabraRules > Error.
Pick each field with Insert Field or Group and switch the picker to QdabraRules (Secondary); do not type the names. The Dynamic Data Connections XTP uses the same pattern (FormsDesigner User Manual, section 7.4).
2.6 Check the environment variables
The XTP reads the DBXL address, user key mode, database name and optional Microsoft Graph keys from the FormsViewer environment variables set in Chapter 1, section 1.6. Nothing about them is stored in the template.
2.7 Choose where the form is submitted
Central Flows can submit the form to a SharePoint library or to DBXL. Set up one of the two.
2.7.1 SharePoint library
Have the SharePoint library ready before you start.
- In v2_XtpLogic_CentralFlows, select
XtpLogic/Actions/SetSubmitMode, open the rule * Set Submit Mode, and set SubmitMode toSharePoint. - Add a Submit to SharePoint Library data connection. For FileName, click fx, then Insert Field or Group, and pick v2_XtpLogic_CentralFlows > XtpLogic > Values > FormName.
- Select
XtpLogic/Actions/SetShPLibraryName, open the rule * Set SharePoint Library Name, and enter the library's name. - Select
XtpLogic/Actions/SharePointSubmitand open the rule * Submit SharePoint. Remove the action that sets@stopto an empty value, add a Submit data action, and select the connection from step 2.
Use the library's internal name, not its display name. It is the part of the library's address just before
/Forms/, for exampleExpenseReportsinhttps://yourtenant.sharepoint.com/sites/YourSite/ExpenseReports/Forms/AllItems.aspx.
2.7.2 DBXL
Select XtpLogic/Actions/DbxlActions/DbxlSubmit, open the rule * Set Values for DBXL Submit, and enter the name of the DBXL document type that stores this form.
2.8 Fix the duplicate-button rule
In the XTP section on the canvas, select the repeating section that shows the workflow buttons and click Rules. Open the formatting rule Hide if Same Button, click its Condition, and replace the expression 1 with:
count(preceding-sibling::*[CurrentStatus = current()/CurrentStatus and Action = current()/Action]) > 0
This hides a button when an earlier row already shows the same action for the same status.
2.9 E-mail notifications
Out of the box, every workflow action sends the Central Flows standard e-mail to the new assignee, through a DBXL e-mail mapping that you set up once. To skip it for some actions or states, or to send your own e-mail instead, see Chapter 4, section 4.4.
2.10 Footer
The XTP adds a footer section, my_footer, at the bottom of the form. It has three parts:
- Version button (left). It should show the template version, for example "Solution Version: 1.0.0.25". The XTP inserts the formula as plain label text, so the button first shows the formula itself (
concat("Solution Version: ", ...). To fix it: select the button, copy the text in Label in its properties, click Dynamic next to Label, paste the text into the formula box, and click OK. The formula is:
text
concat("Solution Version: ", substring-before(substring-after(/processing-instruction()[local-name(.) = "mso-infoPathSolution"], 'solutionVersion="'), '"'))
- History icon (middle). Opens the approval history.
- Copyright (right). A calculated value,
concat("© ", substring(xdDate:Today(), 1, 4), " Qdabra Software"), so the year always follows today's date. To show your own organization, edit this calculated value and replaceQdabra Software.
2.11 Session timeout
The form warns an inactive user after 10 minutes and then counts down 60 seconds before signing them out and releasing the lock. To change the times, switch the data source to InactivityCheck_CentralFlows, select FormLogic/Actions/CheckInactivity/@triggerCheckInactivity, and edit the rule ** Set Time Durations (10m60s).
2.12 Optional: Authy verification
Skip this section unless you want users to confirm their identity with a smartphone (Authy) when they open the form. To use it, select XtpLogic/Actions/SetCurrentUser in v2_XtpLogic_CentralFlows, open the rule *Run Authy, and set your Twilio API key (see "Create Authy API Key" in the package).
2.13 Finish
- Delete the XTP's instruction section from the canvas (it ends with "Delete this entire section if no longer needed").
- Save the template.
- Open a new form from FormsViewer and check that it loads without errors and shows the task pane.
- Define the workflow steps of this template in the Central Flows Config form (Chapter 3).
For help, active customers can use the Customer Support Portal. For anything else, use Contact Us or e-mail [email protected].