Scripting

From Data Islands

To automate Data Islands flows you can write a script and run this

First we will create a PUSH script.

Here is an example that connects and queries a Sage 300 ERP databse on MSSQL server.

The scenario here is one where you want some customer data (from table ARCUS) to provide to a sales rep. You only want to provide contact information and exclude financial information.

Open notepad and copy the contents below into it (replacing the items in CAPS with your credentials) and save as "demopush.tsd"

connect USERNAME PASSWORD

addserver sql SERVERNAME SQLUSER SQLPASSWORD

usedb saminc

addregion Sage300Marketing

deleteisland arcuslist

querydb "SELECT NAMECUST,NAMECTAC,TEXTPHON1,TEXTPHON2,EMAIL1,EMAIL2 FROM ARCUS WHERE PRICLIST='WHS'"

push arcuslist

dcdc

USERNAME = Data Islands acocunt username

PASSWORD = Data Islands acocunt password

SERVERNAME = Your SQL server name

SQLUSER = Your SQL server user

SQLPASSWORD= Your SQL server password


This creates the region "Sage300Marketing" (or switches to it if it already exists) and an island "arcuslist" (we delete this and recreate in fact) with the data from the querydb SQL.

This is hosted on the Data Islands cloud.

You can test this from within the app also. This is useful when writing. Using the

>script "FILEPATH"

eg

>script "c:\sample\demo\demopush.tsd"

and this will allow you run and test a script.

Next up we want to automate this.

Using windows taskmanager you can run the dataislands app and pass in the "demopush.tsd" as a parameter. The app will then run the script.

EG

TSDataIslands.exe "c:\myscripts\demopush.tsd"