Skip to main content

How to connect a template to base data path

Presenting the Content Concept​

In our example we will show you how to effortlessly connect a menu template with built-in functionalities to a data source without adjusting widget bindings one-by-one using the Base data path functionality. img_5.png

Creating the Data Source​

Start with an internal datasource of the Table type, called Food Menu:

  1. Navigate to Settings > Datasources and open the Internal Datasources tab.

  2. Click the round + button, labeled Add internal datasource on hover. Name it Food Menu, select the Table structure type, and click Save and open.

    The new datasource opens with no worksheet yet:

    A freshly created internal Table datasource, open in the editor with no worksheet

  3. In the table editor, click the Import from JSON icon, paste the JSON below, and click Confirm.

    The Import from JSON window with its starting template and the Confirm button

  4. Click Save.

{
"Food Menu": {
"header": {
"Meal name": "string",
"Price": "string",
"Quantity": "number",
"Status": "string"
},
"rows": [
{
"Meal name": "Sichuan Duck",
"Price": "$ 10.85",
"Quantity": 0,
"Status": "NEW"
},
{
"Meal name": "Spicy Eggplant",
"Price": "$ 10.65",
"Quantity": 0,
"Status": "NEW"
},
{
"Meal name": "Salad with Bamboo Stalks",
"Price": "$ 10.65",
"Quantity": 0,
"Status": ""
},
{
"Meal name": "Spicy Duck",
"Price": "$ 9.75",
"Quantity": 1,
"Status": ""
},
{
"Meal name": "Chinese Eggplant",
"Price": "$ 7.45",
"Quantity": 0,
"Status": "SALE"
},
{
"Meal name": "Baked Shrimp",
"Price": "$ 12.95",
"Quantity": 0,
"Status": ""
},
{
"Meal name": "Wonton with Shrimp",
"Price": "$ 10.95",
"Quantity": 1,
"Status": ""
},
{
"Meal name": "Salad with Shrimp",
"Price": "$ 10.95",
"Quantity": 1,
"Status": "NEW"
},
{
"Meal name": "Stir Fried Beef",
"Price": "$ 12.15",
"Quantity": 1,
"Status": "SALE"
},
{
"Meal name": "Pork in Batter",
"Price": "$ 9.45",
"Quantity": 1,
"Status": ""
}
]
}
}

Learn more: Import from JSON

Connecting to Base Data Path​

Each piece of content can have a base data path, allowing all widgets with data-binding to pull from it. Widgets need to be linked to this base path to use it effectively.

This setup means you only need to create and bind your content once. You can then dynamically switch the data as long as the new data follows the same structure.

Connect a template to base data path

menu-base-datapath.zip

Download
  1. Import the Content provided
  2. Connect to base data path with Content > Base data path

basedata.png

  1. And select the created data source

datapicker.png

  1. Preview your content

preview2.png

How does Base Data Path Work?​

The text widgets in the content are designed to use the Base data path from the content. Each widget has a Depend on base data path button in the upper left corner. With this feature enabled on all widgets, you only need to swap the data source to update your content seamlessly.

img_4.png

This way you can keep reusing the same content, and you can change out the data sources with ease.

Sold out and Status tags​

If you look at your content in the preview you will see that some of the items don't have pricing

soldout.png

These price tags are set-up with Bind anything. Simply go to the widget's Other tab and click the Bind Anything button.

bind-anything.png

And have Data picker setup with a Hide rule based on the item's Quantity and will hide the item if the field is 0.

hide-based-picker.png

Please note

Hidden items and widgets will also be put down by the device as an element, this means if you have too many hidden items they will slow down your screen.

Having the NEW and SALE tags works the same way, but instead of Quantity, it will rely on the Status field, and if it is empty or not.

img_19.png

Switching out data sources: switching between two internal data sources with the same structure​

Your content, using the provided data source, will look like this

img_5.png

To update with different data (new item names, prices) while keeping the same structure, create a new internal Table datasource the same way, and import this JSON into it:

{
"New Table 1": {
"header": {
"Meal name": "string",
"Price": "string",
"Quantity": "number",
"Status": "string"
},
"rows": [
{
"Meal name": "Tai Garden 2",
"Price": "$ 13.40",
"Quantity": 0,
"Status": ""
},
{
"Meal name": "Citrus Asian Crunch",
"Price": "$ 12.39",
"Quantity": 1,
"Status": "NEW"
},
{
"Meal name": "Caesar w Chicken",
"Price": "$ 11.29",
"Quantity": 1,
"Status": ""
},
{
"Meal name": "Spicy Asian Sesame",
"Price": "$ 11.29",
"Quantity": 1,
"Status": ""
},
{
"Meal name": "Green Goddess Cobb",
"Price": "$ 12.39",
"Quantity": 1,
"Status": ""
},
{
"Meal name": "Zesty Fuji Apple",
"Price": "$ 11.29",
"Quantity": 1,
"Status": "NEW"
},
{
"Meal name": "Wonton with Shrimp",
"Price": "$ 10.95",
"Quantity": 1,
"Status": "SALE"
},
{
"Meal name": "Salad with Shrimp",
"Price": "$ 10.95",
"Quantity": 1,
"Status": ""
},
{
"Meal name": "Stir Fried Beef",
"Price": "$ 12.25",
"Quantity": 0,
"Status": "NEW"
},
{
"Meal name": "Pork in Batter",
"Price": "$ 9.45",
"Quantity": 0,
"Status": ""
}
]
}
}

Base data path setup will be the same as before, just swap out the data source to the newly created one img_7.png

After changing the data source you will need to refresh the data bindings

img_8.png

The content will look like this with the updated menu items img_9.png

Switching from the Quick Editor​

If the base datasource is made quick editable, a contributor can switch it without opening the Content editor at all: they pick another datasource in the Datasource field of the Quick Editor. This only works if the replacement uses exactly the same names, including the worksheet name (Food Menu rather than New Table 1), because the Quick Editor keeps the address the Content already reads. If a name does not match, the Quick Editor lists the affected Widgets under Broken data bindings.

Learn more: Switching the base datasource in the Quick Editor

Switching out data sources: switching internal data source to external​

Please note

Google Sheets and Microsoft Excel won't have the same structure as the provided internal data source, so the content won't work as expected.
This also applies to internal data sources with a different structure than the example provided earlier.

For our example we will use a Google Sheet as the datasource. To connect one, Wallboard needs a Google credential that can read your spreadsheets:

  1. Navigate to Settings > Cloud Credentials and add a Google credential (Add Google credential).
  2. Select the Google Sheet scope, name the credential, and sign in with the Google account that can open the spreadsheet.

The three Google credential scopes: Google Calendar, Google Drive and Google Sheet

Then create a Googlesheet external datasource with that credential, and select the spreadsheet and the sheet to read.

Learn more:

Please note

It is important to switch on the First row is header option

The example Google Sheet is a simple breakfast menu

img_10.png

The base data path is the following img_11.png

Of course this is not the same structure as used before, so the widgets right now don't have the correct binding, and break

img_12.png

You can remedy this on every widget by correcting the data binding on the widget's Main > Bind to data and on the Other > Bind anything options

img_13.png