Step 4: Data Tables (cont.)
Set Properties
We now have the Thing with Properties that we want logged, the Service to do said logging, and the Data Table to where the values will be stored
At the top, click Properties and Alerts.
- Note Data_Table_Test_Thing’s Index_Property and Value_Property.

- On the Index_Property line under the Value column, click the "Pencil" icon for Set value of property.

- In the slide-out on the right, enter 1.

- At the top-right, click the "Check" button for Set.
- On the Value_Property line under the Value column, click the "Pencil" icon for Set value of property.
- In the slide-out on the right, enter 10.

- At the top-right, click the "Check" button for Set.
- At the top, click Save.

Store to Data Table
- At the top, click Services.

On the Add_Data_Table_Entry_Service line under the Execute column, click the "Play" icon for Execute service.

- At the bottom-right, click Execute.

- At the bottom-right, click Done.
Retrieve from Data Table
- Return to Test_Data_Table.

- At the top, click Services.
- Scroll down and locate the QueryDataTableEntries built-in Service.

- On the QueryDataTableEntries line, click the "Play" icon for Execute service.
On the bottom-right of the pop-up, click Execute.
- Note that you should see a single entry, showing the Index_Field at 1 and the the Value_Field at 10

- On the bottom-right, click Done.
If so desired, you may repeat the previous steps to add additional entries to the Data Table. You will note that the Index and Value fields of the Data Table continue to change in each entry to whatever you have set.
Utilizing the functionality of the QueryDataTableEntries built-in Service was just a way to show that the Index and Value items had been correctly logged to the external Data Table.
If you wanted to visualize the Data Tables in a grid, it would be as simple as utilizing the Grid Widget and tying Test_Data_Table -> QueryDataTableEntries -> All Data to said Grid.
Step 5: Info Tables
Just like with Streams and Data Tables, an Info Table requires a Data Shape to format it.
In this example, we'll actually use the exact same Data Shape we previously created for the Stream.
Create Thing
Info Tables are another way to perform non-time-series data storage within the ThingWorx platform.
Info Tables used for storage are tied directly to a particular Thing. As such, they are somewhat non-optimal for situations where you’re wanting to aggregate data across multiple Things.
Info Tables are a Property Base Type in ThingWorx, in the same manner as a Number, Integer, or String.
- On the ThingWorx Composer Browse tab, click Modeling > Things, + New.

- In the Name field, enter Test_Info_Table_Thing.
- If Project is not already set, search for and select PTCDefaultProject.
- In the Thing Template field, search for and select GenericThing.

- At the top, click Properties and Alerts.
- Click + Add.
- In the Name field, enter Info_Table_Property.
- Change the Base Type to INFOTABLE.
- In the Data Shape field, search for and select Test_Data_Shape.
- This is the same Data Shape we previously created for the Stream. We're just reusing it for formatting the Info Table.
- Check the Persistent checkbox.

- At the top-right, click the "Check" button for Done.
- At the top, click Save.

Set First Value
Now that we have a Thing with an Info Table Property (formatted by our Data Shape), you can set some values for later display in a Mashup.
- On the new Info_Table_Property line under the Value column, click the "Pencil" button for Set value of property.

- On the new pop-up, click the + Add button.

- In the Index_Field, enter 1.
- In the Value_Field, enter 11.

- At the bottom-right of the pop-up, click Add.
Set Second Value
- On the pop-up, click the + Add button.
- In the Index_Field, enter 2.
- In the Value_Field, enter 22.

- At the bottom-right of the pop-up, click Add.
Set Third Value
- On the pop-up, click the + Add button.
- In the Index_Field, enter 3.
- In the Value_Field, enter 33.

- At the bottom-right of the pop-up, click Add.

- At the bottom-right of the pop-up, click Save.
- At the top, click Save.

Create Mashup
Now that we have a Thing with an InfoTable Property and some value-entries in said InfoTable, let's create a Mashup to display those values by using the Grid Widget.
- On the ThingWorx Composer Browse tab, click VISUALIZATION > Mashups, + New.

- On the New Mashup pop-up, leave the defaults, and click OK.

- In the Name field, enter Test_Info_Table_Mashup.
- If Project is not already set, search for and select PTCDefaultProject.
- At the top, click Save.

- At the top, click Design.
- With the Widgets tab selected in the top-left, drag-and-drop a Grid Advanced Widget onto the central Canvas area.

Bind Data
On the far-right, ensure that the Data tab is selected.
- Note that you may have to expand this area from the far-right.

Click the + icon.
- The Add Data pop-up will appear.

- In the Entity Filter field, search for and select Test_Info_Table_Thing.
- In the Services Filter field, enter getprop.
- Click the right arrow beside the GetPropertyValues Service.
- On the right under Selected Services, check the Execute on Load checkbox.

- At the bottom-right of the pop-up, click Done.
- Note that Test_Info_Thing -> GetPropertyValues is now available under the Data tab at the far-right.
- Expand GetPropertyValues > Returned Data > All Data.
- Drag-and-drop GetPropertyValues > Returned Data > All Data > Info_Table_Property onto the Grid Advanced Widget in the central Canvas area.

- On the Select Binding Target pop-up, select Data.

- At the top, click Save.
- At the top, click View Mashup.

The new Mashup displays all of the Index and Value fields you had previously entered.
If you were to add additional entries to the Info Table Property and then refreshed the Mashup, you would see those additional entries as well.
Step 6: Next Steps
Congratulations!
In this guide, you've learned how to:
- Differentiate between data storage methods
- Create a Data Shape to format a Stream, Data Table, and Info Table
- Create a Value Stream and Stream to store Time-Series Data
- Create a Data Table and Info Table to store non-Time-Series Data
- Use built-in methods to log data to a Value Stream or Info Table
- Create custom Services which log data to a Stream or Data Table
- Confirm data storage value changes via a built-in Service or Grid Widget
Learn More
We recommend the following resources to continue your learning experience:
Additional Resources
If you have questions, issues, or need additional information, refer to: