Apps to support conversations, where a customer can reach over and touch the employee’s screen, make changes and ultimately own the solution

Apps with the smarts to help users make on-the-spot decisions by offering choices first and allowing trade-offs later

Apps for tasks that involve capturing real world information through photos, videos and voice

Project Siena’s Tagline Is an Oxymoron

I have never seen a real-world business app, powerful or not, that didn’t require at least some custom Visual Basic, VBA, C#, Java, JavaScript or code in another programming language. For its Visual Studio LightSwitch rapid application development (RAD) tool, Microsoft claims:

When you use LightSwitch, much of the repetitive work is done for you and, in fact, you can create a LightSwitch application without writing any code at all! For most applications, the only code you have to write is the code that only you can write: the business logic.

A couple of weeks back I took a look at Project Siena, a preview of a new tool for building Windows 8 apps. Project Siena features a simplified user interface builder, an Excel-like expression language, and data-bound controls. It generates Windows 8 JavaScript apps. Project Siena is itself a Windows Store app, and runs fine on Windows RT (the ARM version). I have been using it successfully on Surface 2, on which it runs sweetly. [Emphasis added.]

When I first looked at Project Siena I tried to build the same first app that I have used for numerous simple tests of development tools over the years: a to-do list. I was impressed by how easy it was to create the user interface, but unable to work out the code to complete it. Unless I missed it, the key information is not included in any of the initial documentation. I found this disappointing, since it has been easy to work out the code in every other programming environment I have tried. …

In Siena, data is stored in Collection objects, and you can bind a listbox to a collection. By default, a new listbox is bound to an object called ListboxSample, but you cannot use it for this; if you try, you get a squiggly line error with the message that ListboxSample is not a collection.

Instead, you have to create your own collection object. In Siena, you declare a variable by using it and its type is inferred. Enter this for the OnSelect property of the Add button:

Collect(mycollection,{Value: InputText1!Text})

This is the code that took me so long to work out. The Collect function adds an item to a collection. If the collection does not already exist, it creates it. The first argument to Collect is a collection object, and the second, an item. What is an item? In effect, a record or row in a table. The syntax for an item in Siena is:

{Fieldname1: fieldvalue1,Fieldname2: fieldvalue2,…}

where the dots represent additional fields as required. Therefore, the code I entered for the Add button creates or appends an item with a single field, called Value, to a collection called mycollection.

Now you can select the listbox and tap Data and then Items. The collection called mycollection magically appears for selection. Select it. In the case of multi-field collections, you can also choose which field appears in the list. Only one field it seems; yes, Siena needs a grid control. … [Emphasis added.’]

Defining function expressions to respond to events sounds like programming to me. The Microsoft Project Siena Function Reference lists two operators and 71 functions, many of which have complex argument lists. Even inline If() expressions are supported:

Instructions for Importing Windows Azure Mobile Services

If your enterprise uses Windows Azure Mobile Services, contact your IT department or the administrator of the account for the account details. Then add [W]AMS tables as data sources to your app:

Click the + control in the Data Sources backstage.

Click Azure Mobile Services in the Data Sources menu.

You will be prompted for the URL (usually of the form https://<EnterpriseName>.azure-mobile.net) and AppKey (this is generated when the account is set up; use an application key and not the master key). Enter this information and click the search icon.

All the tables in your [W]AMS instance are listed. Select one or more of the instances and then click Import Data to import the data into your app.

Note that in the current release, we support a simplified and lightweight interface for accessing [W]AMS data. As part of the [W]AMS setup, your IT administrator will also need to create a table named "zz_config" in your [W]AMS instance for Siena to be able to interact with it. This table should contain the following columns:

Key: This should be set to “table”.

Value: String value that stores the table name.

The zz_config table should contain one row per table that you want to expose to Siena. For example, if you want to allow Siena to access Employee and Sales tables, your zz_config table will have the following entries:

Key

Value

“table”

“Employee”

“table”

“Sales”

Apparently, the Project Siena team didn’t get the memo that “Windows Azure whatever,” not “Azure whatever,” is the naming convention.

Connecting a Project Siena App to Other Data Sources

How do I import data into my app?

Links to data sources can be added to your apps for importing data. Create these links through the Data Sources backstage, which can be accessed as follows:

Display the app bar by right-clicking anywhere on the canvas or by swiping down from the top of the canvas.

Click File, and then click Data Sources.

Click the + control to bring up a list of possible data sources.

The current release of Siena supports the following types of data sources that are displayed as options when you click the + control.

Excel

Windows Azure Mobile Services (AMS)

REST

RSS Feed

SharePoint Lists

Note that your SharePoint site, REST web services, or RSS Feed should not be running on the same device as the published app. If this condition is not met, the app will not be able to access the service because of a security restriction with Windows 8 apps that prevents from calling into web services running on the same device. …

How do I import Excel data into my app?

Perform the following steps to import Excel data into your app:

Click the + control in the Data Sources backstage.

Click Excel in the Data Sources menu.

This will bring up the Windows 8 file picker. Browse to the location where your Excel file is stored, select it, and click Open.

All the tables within the Excel workbook you selected are displayed. Select one or more tables from the displayed list, and then click Import Data to import the data into your app.

Note that only Excel tables will be imported (see Create an Excel table). If the data has been imported successfully, the first three rows of the table will be displayed.

How do I use REST connectors?

Consume data from REST connectors in your app by following these steps:

Click the + control in the Data Sources backstage.

Click REST in the Data Sources menu.

Enter the URL for your REST service.

Choose an authentication method from the drop-down list box.

Select the Enable headers check box, if you want to specify any additional custom headers.

Import the data.

All the tables exposed through your REST service are imported into your app.

Siena can fetch data from REST services using GET requests (your proxy must support GET requests at the supported endpoints) if the following requirements are satisfied. Please contact your IT administrator about these requirements if you are having trouble connecting to your enterprise’s REST services.

How do I import SharePoint lists into my app?

Perform the following steps to import data from SharePoint lists:

Click the + control in the Data Sources backstage.

Click SharePoint in the Data Sources menu.

Enter the URL to your SharePoint site, and then click the search icon.

All the lists on your SharePoint site to which you have access are displayed. Select one or more lists, and then click Import Data” to import the data into your app.

Note that in the current release of Siena, a link to SharePoint data is not live—changes made to the list on the server are not immediately reflected in the app. When loading, the app takes a "snapshot" of the data on the SharePoint server.

How do I import RSS feed data into my app?

Perform the following steps to import data from RSS feeds:

Click the + control in the Data Sources backstage.

Click RSS Feed in the Data Sources menu.

Enter the URL to your RSS Feed and click the search icon

All the RSS feeds in your specified URL to which you have access are displayed. Select one or more feeds, and then click Import Data to import the data into your app.

Note that in the current release of Siena, a link to RSS Feed data is not live—changes made to the feed on the server are not immediately reflected in the app. When loading, the app takes a "snapshot" of the data on the RSS Feed server. In the current version of Siena, only Atom and RSS 2.0 feeds are supported. …

The Missing Link

The question remains how to use the imported data and how to update it, if possible. This undoubtedly requires code but Project Siena’s three current sample apps, AdventureWorks, Real Coverage Finder and Personnel Manager, don’t appear to use external data sources.

The dual Web role application has been running in Microsoft's South Central US (San Antonio) data center since September 2009. I believe it is the oldest continuously running Windows Azure application.

About Me

I'm a Windows Azure Insider, a retired Windows Azure MVP, the principal developer for OakLeaf Systems and the author of 30+ books on Microsoft software. The books have more than 1.25 million English copies in print and have been translated into 20+ languages.

Full disclosure: I make part of my livelihood by writing about Microsoft products in books and for magazines. I regularly receive free evaluation software from Microsoft and press credentials for Microsoft Tech•Ed and PDC. I'm also a member of the Microsoft Partner Network.