Copy Data Between Systems on a Schedule
Copy rows from a database into a lookup table of the app, map the columns, set the times it runs, and run it once to see the result.
What you will learn
- Pick where the rows come from and where they go in Data, Copy between systems
- Choose how rows are written and match the columns by name
- Run it by itself at set times, or run it once with Run now
- Read the run history and see the filled lookup table
Transcript
In this guide you will copy data from one system to another, on a schedule. We will copy the item list from a database into a lookup table of the app, map the columns, set the times it runs, and run it once to see the result.
This app, Stock Sync, has a lookup table named Item list, with columns for the item, the description, the unit, the quantity on hand, and the bin. Right now it holds just one old sample row. We want the real list to come from the warehouse database, and to stay current without anyone typing it.
Open Data, then Copy between systems. A copy is called a transfer. Press Add transfer, and give it a name. We will call it Copy stock list.
Card one is where the rows come from. The choices are a database, a file, a web service, or a table of the app. We use the database. Pick the database connection, and type the name of the table, items. This connection signs in with a read only account, which is all a source needs.
Card two is where the rows go. Here it is already the app table Item list, our lookup table. Under How, the choice is how rows are written. Replace everything empties the list, and then writes this run's rows, so the list always matches the database.
Card three is the columns. Press Match by name. StepVane gives each column of the list the database column with the same name: item, description, unit, on hand, and bin. You can change any of them, or use a fixed value instead.
Card four is when it runs. Choose At set times, and type the time of day, in server time. We use six in the morning, every day. You can type several times, separated by commas, and pick the days of the week. The other choices are every few minutes, or a schedule you write yourself.
The server runs the published version of the app, so publish it. Open Publish, and press the Publish button.
Back in Copy between systems, press Preview first rows. Nothing is written yet. StepVane reads the database and shows the seven rows as they will be written, so you can check the mapping.
Now press Run now, on the right. The result appears under the button: seven rows read, seven written. Under History, every run is listed, with how it started, and how many rows it moved. And Next scheduled run says when it will run by itself.
Open Lookup tables. The Item list now says it is filled by a transfer, and shows the seven rows from the database. The old sample row is gone, and the phones get these rows the next time they sync.
That is how you copy data between systems. A transfer has four parts: where the rows come from, where they go, how the columns match, and when it runs. Publish it once, and the server keeps the data up to date.
Related
More guides
Start with one device today
Free for Studio, one handheld and one worker. No cloud account, no credit card.