TIBCO Cloud™ Spotfire® Web Client User Guide

Adding a bar code reading capability

By adding the document property AppMachineReadableCode to your analysis, you can activate the bar code reader capability of an iOS mobile device that uses the analysis.

Before you begin

Some of the functionality described here can only be authored or accessed using the installed Spotfire client.

About this task

Note: The data table you import must have a column containing the data for either a bar code or a QR code. This column must be of the data type String.
Tip: When you import the data using the installed client, you can check the Import Settings dialog to make sure the column containing the code has the right data type. You can also change the data type later.

Adding bar code reading capabilities for your mobile users

Procedure

  1. Open data that contains a string column of bar codes or QR codes.
  2. Create a Table visualization.
  3. On the menu bar, select File > Document properties, and in the Document Properties dialog, click the Properties tab.
  4. Click New, and in the dialog, provide the reserved name AppMachineReadableCode.
  5. Set the Data type to String. Save the changes.
    You can leave the default value blank.

Results

The bar code is added.

Your visualization now has the document property required to activate the bar code reading icon on an iOS device (available for a consumer user, in the cloud or on premises).

Next, add a text area to show the code that the iOS mobile device scans.

Adding a text area to show a scanned code

Procedure

  1. On the authoring bar, click to open the Visualization types flyout.
  2. Drag the Text area to the wanted position on the analysis page.
    A blank text area is created.
  3. Right-click the new text area, and click Properties.
  4. In the dialog, provide a title, such as "Scanned code", and then close the dialog to save the change.
  5. Click the Edit text area icon, and in the Edit Text Area dialog, click the Insert Dynamic Item icon and choose to add a Calculated Value.
  6. Under Values, right-click the selector under Calculate values using and select Custom Expression.
  7. In the Custom expression dialog, add the expression ${AppMachineReadableCode} and click OK.
    This expression inserts the document property value as text. See also Properties in expressions.
  8. If desired, in the Edit Text Area dialog, provide a text label for the dynamic item.
  9. Resize the text area to contain just the added item and the title.

Results

The text area can now display a scanned code.

You now have a text area where a scanned bar code or QR code will be shown when a code is scanned by an iOS mobile device using the analysis. For example, the following image shows a text area for containing the ISBN code, which appears as a bar code on the backs of books. The text box will display a captured ISBN code when the code is scanned using a mobile device.



Next, create an expression to filter a visualization to the scanned bar code.