Manage data in a Project Siena gallery

 

After you put a set of data into a gallery in Project Siena, you can filter that data, sort it, save selected items to separate list, and perform other tasks that help you get the most from your data. For a general overview of Project Siena and links to resources such as sample apps, video tutorials, and forums, see Project Siena.

Examples in this procedure use this data source, named RevenueLedger:

Product

Year

Revenue

Bongos

2012

$14,000

Trombones

2012

$15,000

Trombones

2013

$17,000

Bongos

2013

$19,000

Trombones

2014

$21,000

Violins

2012

$21,000

Bongos

2014

$23,000

Violins

2013

$26,000

Violins

2014

$28,000

Prerequisites

  1. Import data or create a collection, and then create a custom gallery that shows your data source.

  2. Add a Radio, Listbox, or Drop-Down control, and set its Items property to a function that follows this syntax:

    Distinct(DataSourceName, ColumnName)

    For example, you could use this function to show the name of each Product in the RevenueLedger data source only once, even though those names appear multiple times in the original data source:

    Distinct(RevenueLedger, Product)

    Radio-button control with three options

  3. Set the Items property of the gallery to a function that follows this syntax:

    Filter(DataSourceName,ColumnName = RadioControlName1!Selected!Value)

    For example, you could use this function to show only those rows in the RevenueLedger data source that contain information about the product chosen in a control named FilterCriteria:

    Filter(RevenueLedger, Product = FilterCriteria!Selected!Value)

  4. Click an option in the list to show only those rows that match your criteria.

    Gallery filtered by a radio-button control

  5. (optional) Filter by multiple criteria:

    1. Add another Radio control, and set its Items property to a function that follows the same syntax as the Items property for the other list.

    2. Set the Items property of the gallery to a function that follows this syntax:

      Filter(DataSourceName, ColumnName = RadioControlName1!Selected!Result && RadioControlName2!Selected!Result)

      Two radio button controls filter a gallery

  6. (optional) Filter by partial-match text from the user:

    • Add an input-text control, and change the Items property of the gallery to a function that follows this syntax:

      Filter(DataSourceName, InputControlName!Text in ColumnName)

      For example, you could use this function to show only those rows in the RevenueLedger data source in which the values in the Product column contain the string in the FilterCriteria box:

      Filter(RevenueLedger, FilterCriteria!Text in Product)

      An input-text control that filters a gallery

  1. Import data or create a collection, and then create a custom gallery that shows your data source.

    Examples in this procedure use this data source, named RevenueLedger:

    Product

    Year

    Revenue

    Bongos

    2012

    $14,000

    Trombones

    2012

    $15,000

    Trombones

    2013

    $17,000

    Bongos

    2013

    $19,000

    Trombones

    2014

    $21,000

    Violins

    2012

    $21,000

    Bongos

    2014

    $23,000

    Violins

    2013

    $26,000

    Violins

    2014

    $28,000

  2. Change the Items property of the gallery to a function that follows this syntax:

    Sort(DataSourceName, ColumnName)

    By default, the function sorts data in ascending order, but you can add a parameter to sort the data in descending order. For example, you could use this function to sort the RevenueLedger data source so that values in the Revenue column appeared in descending order:

    Sort(RevenueLedger, Revenue, SortOrder!Descending)

    Gallery sorted by last column (descending order)

  1. Import data or create a collection, and then create a custom gallery to show your data.

  2. Click the label in the upper-left corner of the gallery, press Alt-V, click Shapes in the list that appears, and then click Rectangle.

  3. In the Design category, set the properties of the rectangle to these values:

    • Fill: RGBA(0, 0, 0, 0)

    • Border Style: BorderStyle!Solid

    • Border Thickness: 2

    • Border Color: RGBA(192, 0, 0, 1)

  4. Move the rectangle toward the left edge of the gallery, and resize the rectangle so it fits around each item in the gallery.

    A gallery with a red rectangle around each item

  5. With the rectangle still selected, click Options near the bottom of the window, and then click the Visible icon (on the left side, near the bottom of the dialog box that appears).

    Icon for the Visibility property

  6. In the text box, type the following function:

    If(ThisItem!IsSelected, true, false)

  7. Press F5, click any item in the gallery, and then click another.

    The red rectangle appears only around the item that you clicked most recently.

  8. Press Esc to return to the design workspace.