NorthWind Customer Flow Development
We will now develop a Webhook Flow to reload Customer data from the Northwind OData Service. This data will then be the content of a Select (Dropdown) component so that the user can select the required customer. Note that the data will be fetched online when the form is loaded and hence is not suitable for an offline solution.
Flow Development
Section titled “Flow Development”- In the Forms list, click on the
Flowsicon on theComputer Inspectionrow - A list of Flows will be displayed. Now click on the
Createbutton and choose theWebhook Flowoption- Title - Enter Get Custoemrs
- Description - Enter description as Gets Customers from Northwind or similar
- Set the desired Expiry Date
- Click on
Saveto create the flow
- You will now be navigated to the Flow Builder
Understanding the steps
Section titled “Understanding the steps”We need to configure and call the Northwind OData service to retrieve Customer records. Subsequently we need to return it as an array of JSON objects so that it can be used as the data for a Select (dropdown) component in the form.
Now let us draw a flow chart of the different steps we need to perform to retrieve the Customers:
flowchart TD
A([Start]) -->|Webhook Flow| B[Call OData Get Customers]
B --> C{Error}
C --> |Yes| G([ReturnError])
C --> |No| D[Extract Customers]
D --> E[Return Customers]
E --> F([Return Success])
Developing the Flow
Section titled “Developing the Flow”- In the Flow Builder, the
Add Nodedialog should already be open. If not, click on theWebhook Flowstart node and then click on the :fontawesome-solid-circle-plus: icon that is displayed below the node - Search for the
ODatanode by typing in odata and clicking on it - The
ODatanode is now opened and you can configure it.- Change the title to
Get Customersand remember to connect theWebhook Flowstart nodeSuccessconnector to this node (else the expression builder will not display all the possible fields and nodes) - Since we want to work with an OData system we need to first create it. Click on the :fontawesome-solid-plus: icon next to the SAP Server dropdown. Note that we will be using the Northwind OData system described (here)[https://www.odata.org/odata-services/] and more specifically the (Northwind OData v3 service)[https://services.odata.org/V3/Northwind/Northwind.svc]
- The
Add Systemdialog is displayed. Enter the following data:- Description: Northwind (or anything else you desire)
- Identifier: This is a unique identifier for the system, enter odata-nw
- URL: Set it to https://services.odata.org/
- Service Path: Set it to V3/Northwind/Northwind.svc/ As you probably noticed we just split the service URL from above into the URL and path
- Type: Set to Others
- Authentication: Set to None
- Save the system
- Change the title to
- Now choose the newly added
odata-nwsystem in the Server dropdown - Set the
OData Operationto Select as we are going to select a list of customers - Click on the
OData Entitydropdown and wait for it to populate. Now select Custoemrs - Leave the
Expand Mappingas Default. Since we are only looking for Customers we will not be choosing any additional entities. If needed you can also click on the Expand dropdown and select any additional entities you want to expand for the Customer records. - Click on the
Fieldsdropdown and choose CustomerID and CompanyName fields. - Click on Save.
- Select the
Get Customersnode and click on+and search fro response and select theResponsenode. - The
Responsenode is now opened and you can configure it.- Change the title to
Return Listor similar and remember to connect theGet CustomersnodeSuccessconnector above to this node (else the expression builder will not display all the possible fields and nodes) - Select the Success option
- Set the
HTTP Codeto 200 to signify HTTP Success - For
Bodyclick on the :fontawesome-solid-wrench: icon to open the Expression Builder - Select Result below the
Get Customersentry - Now Click on the :fontawesome-solid-floppy-disk: icon and save the node
- Change the title to
- Now click on Publish button to save and compile the flow. If the compilation is successful it will also be published and we can run it to test.
Testing the Flow
Section titled “Testing the Flow”- Now that we have published the flow we are ready to test it. The Flow Builder has an integrated Run and Debug tool to help us troubleshoot the flow in case of errors.
- Now click on the Run Flow button. The Run dialog is now displayed. An error that there is no Form (test) data is displayed. You can enter Form (test) data now by clicking on the
Form Databutton. Enter the values for the different fields based on your system setup making sure that they are correct. - Run the flow by clicking on the
Runbutton. The flow should run successfully. - If there are errors it could be due to some mistakes in entering test data, configuring the system or copy/pasting the expression or similar. Check each step carefully with the documentation above.
- In the result after run you should see a list of Customers returned by the Northwind OData service.
Note that the Turbo Apps app will run the flow on the schedule and reload master data every Monday.
Add a Customer dropdown and testing the form
Section titled “Add a Customer dropdown and testing the form”- We will first need the webhook URL to the flow we just developed. From the
Flowslist click on theUpdateicon in the Get Customers row. Copy the webhook URL. - From the forms list click on the
Computer Inspectionform to open the form designer - From Basic, drag and drop
Selectcomponent below the Date field- Change
Labelto Customer and click on the :fontawesome-solid-key: icon to update the API property to customer - Click on Data and under
Data Source Typechoose URL - Paste the webhook URL as the value for
Data Source URL - Set the
ID Pathto CustomerID as we want the customer ID returned by Northwind to be saved as part of the data - Set the
Value Propertyto CompanyName as we want the Company name returned by Northwind to be displayed in the dropdown - Set the
Item Templateto item.CompanyName as that is the required display field - Click on Validation and select the
Requiredfield - Click on API and confirm API name is
customer - Click on Save
- Change
- Now Save the form and click on Preview
- Click on the Customer dropdown. If the list is empty wait a second or two as the call to Northwind (demo service) may take a while. Once the call is successfully completed you will now see a list of customers displayed.
- You can now Publish the form so we can test in the Turbo Forms App
Login to Turbo Forms App
Section titled “Login to Turbo Forms App”Now login to the Turbo Forms App on web or mobile as the same user and click on the + button to create a new form to fill and choose the Computer Inspection form. Click on the Customer dropdown to display the list of Customers.
Topics Covered
Section titled “Topics Covered”- Developing a Webhook Flow to retrieve Customers from the Northwind OData service
- Connecting a Select/Dropdown component to the webhook to retrieve data online and display in the dropdown
- Running the flow and testing it