Use a Database, a File and an API in One Workflow
Build one workflow that fills fields from three places at once: a database lookup, a file lookup and an API call, all from a single scan.
What you will learn
- Find a row in a lookup table that comes from a database
- Find a row in a lookup table that comes from a file
- Call an API in the same workflow and keep a field from its reply
- Add a not found lane with an error beep, then test with Simulate
Transcript
In this guide you will build one workflow that uses data from three different places. A worker scans an item, and the workflow fills in the description from a database, the minimum level from a file, and the quantity on hand from an API.
This app, Stock Check, has an Item to scan, and fields for the description, the unit, the quantity on hand, and the minimum level. Under Data, Connections, we have already added a database, a file, and an API. And under Lookup tables, the database and the file each give us a table.
Now the workflow. Open Workflows, press New workflow, and choose A field is entered. Pick the Item field and name it Item scanned.
First source, the database. Add a step, and choose Find a row. Pick the Items table, which comes from the database. Add a condition: the item column equals the Item field. So it finds the row for the item that was scanned.
Then use Fill a field. Pick the description column, and fill the Description field with it. Press Also fill, and fill the Unit field from the unit of measure column.
Second source, the file. Add another Find a row, and this time choose Reorder levels, which comes from a file. The item column equals the Item field again, and the min qty column fills the Min level field.
Third source, the API. Add a step, and choose Call an API. The connection is Item API. Pick the endpoint, put the Item field in the path, and keep the on hand value from the reply in the On hand field.
Every step that looks something up has a not found lane. On the first step, add a beep with the error tone, so the worker hears at once that the item is not in the database.
Now try it. Press Simulate, and scan an item number. The description and unit arrive from the database, the minimum level from the file, and the quantity on hand from the API, all from one scan.
That is how you combine data sources. Lookup tables, from a database or a file, are found with Find a row, and APIs are called with Call an API. Each step fills fields, and the steps run in order.
Related
More guides
Start with one device today
Free for Studio, one handheld and one worker. No cloud account, no credit card.