Advanced Data Sources: Using Partitions

Available on the Enterprise tier only:

Essentials
Advanced
Enterprise

About

PartitionsClosed Partitions are an Enterprise tier-only filter tool for large data sources. With partitions, users working on a form will only receive data that's relevant to them. There are two kinds of partitions: Dynamic and Regex. are a filtering mechanism applied to large Data SourcesClosed Data sources, also known as "Lookups", are external sources of data that you upload or connect to TrueContext. You can reference this data in a form to populate answers or answer options. Data sources save typing, reduce errors, and make it easy to provide mobile users with only the relevant, most current data. in order to determine what rows of data are relevant to different users/groups. When using mobile forms, each user or group gets a different "partition" of the data set synced to their mobile devices, ensuring they have only the data that is relevant to them.

Info:When you partition a Data SourceClosed Data sources, also known as "Lookups", are external sources of data that you upload or connect to TrueContext. You can reference this data in a form to populate answers or answer options. Data sources save typing, reduce errors, and make it easy to provide mobile users with only the relevant, most current data., you optimize mobile device performance. This doesn’t reduce the actual Data Source size, however. The topic Best Practices for Data Source Size provides more information about how and why we limit the size of your Data Sources. If you’re an Enterprise customer, we recommend that you follow best practices for Data Source size before you request a size limit increase.

Example Scenario

Organizations often have a very large master data set stored in or exported from their backend system. For example, a utility company might have a Data Source containing a list of all gas meters in Oregon. Having that full data set in one piece is meaningful and useful to the people who manage that data.

However, inspectors in the field are not traveling across the entirety of Oregon to inspect meters; they only inspect meters in one small region. Therefore, it's not useful for them to have access to the entire data set. Having the entire data set is resulting in slow reconcile times and could lead to inspectors making a mistake and selecting a meter in the wrong region.

Data Source partitions make it easy to provide those inspectors with only the meters for their region.

Benefits of Using Partitions

  • Manage larger Data Sources without an impact on app performance: When a mobile device reconciles with TrueContext, without partitions, it downloads the entire Data Source. When the Data Source is updated and a device reconciles, it downloads the entire Data Source again. Different mobile devices can store different amounts of data, and some older or lower performance devices may experience performance issues if the file is too large.

    Partitions allow you to keep the data in one Data Source in the TrueContext system but divide up the data for mobile users so they experience the best app performance.

  • Control access to data: Some Data Sources may contain data that should not be available to certain users. For example, a facilities management company has several customers, who each have multiple facilities that they maintain. Some subcontractors manage buildings for Customer A, while different subcontractors manage buildings for Customer B. For contractual reasons, the subcontractors who do work for Customer B are not allowed to see the data for Customer A.

    Partitions allow you to still maintain all the data in one data set, but to restrict subcontractor access to only the relevant data within that set.

  • Usability and Error Reduction: If users have access to a smaller set of data, they will find dropdown lists easier to search and use. They will also be less likely to make mistakes when presented with a smaller list of options.

Adding a Partition

  1. Hover over Manage Forms, confirm that you are in the desired FormSpace, and select Data Sources.

  2. Select the desired Data Source by clicking on its name.

  3. Mouse over the dropdown next to the Data Source name and select Create Partition.

There are two types of partitions; view Dynamic Partitions and Regex Partitions below.

Dynamic Partitions

Dynamic partitions divide the Data Source based on the mobile user's username/User ID or the user's Group Name/Group ID. As you add new users or groups, the partitions will automatically take effect for them.

This is the more commonly used kind of partition and is useful if you want to control every user/group's access to data.

Sample Data Source

Below is a relatively simple Data Source as viewed in a spreadsheet program; this will be used for all examples in this article.

A dynamic partition can be used to filter the data so that when "John Doe" is filling out a form on his mobile device and selects a "Customer" dropdown list, he only sees the customers in rows that have his name in them.  With the same partition, "Jane Doe" can view only her customers.

Set up the Partition

  1. In the above screen, the column selected is "Rep"; this is where the value (Username) to partition by is listed.
  2. The field to match is "Username"; this tells the filtering mechanism to search for the mobile user's Username within the "Rep" column, and give the user access only to data in rows that contain their username in the "Rep" column.

For Field to Match, other options to select from are User ID, Group ID, and Group Name.

Note:  Remember to reference the Data Source in your forms.

Regex Partitions

Regex partitions use Regular Expressions to manually partition the Data Source. You can set up multiple partitions, for individual users or individual groups. If a Data Source is not partitioned, all users with the correct FormSpace permissionsClosed FormSpace Permissions control the permissions that a user group has in a particular FormSpace. These are primarily used to control the forms (and the state of form) users can access on their mobile devices. Less commonly, FormSpace permissions give non-admin Users some administrative access to a particular FormSpace without giving them full Admin access to all FormSpaces. will have access to the full Data Source.

This would be useful if most users are employees and can access all data, but a single group of subcontractors needs restricted access.

Sample Data Source

For example, using the Data Source below, a Regex partition can be used to filter the data so that when users in a particular group select a "Customer" dropdown list, they are shown only users in regions containing the word "Ontario."

Set up the Partition

  1. In the above screen, the column selected is Region, as the regular expression will try to match data in this column.

  2. In order to link the filter only to a particular group, select Group as the Link Type. Other options are User and Everyone.

  3. Select the group to receive the filtered data.

  4. Enter your regular expression. Here we have entered ^.*Ontario.*$ to match any field containing the word "Ontario." Test your regex before deploying it to a production environment.

Set up as above, the group "Demo Group" will see only customers located in Ontario (whether it be Western, Eastern or Central) in their customer list. Multiple partitions can be set for the same Data Source -- for example, a different partition can be made to show another group only customers located in "Western Canada."

Note:Remember to reference the Data Source in your forms.