How elements get their data: field, element and transform

In this article we show how elements get their data values and the different attributes you can edit to change an element's data source.

Initial data values

By default each element looks for a data column with a column name equal to the key of the element. For instance, element Q1 will get is data from data column Q1.

Bar chart displaying Q1 question about Condition X patients receiving gamma antagonist, showing distribution across ranges from 0 to 71-80, with highest percentage at 68.0% for 1 to 10 patients.

Field attribute

You can specify a different data column using the field attribute. For instance element Q1a_recoded's field is set as Q1a. When you clone an element the field is automatically set as the key of the original element. If the original element itself had a different field, then the clone would have the same field. 

Protobi interface showing element cloning workflow with original Q1a question about Hanahaki Disease medications on left, recoded version Q1a_recoded on right displaying consolidated drug responses, and properties panel showing key='Q1a_recoded' and field='Q1a'.

You can specify more than one data column for field.  For instance, Q7 has its field attribute set to an array: Q7_1, Q7_2.  This can be an effective, lightweight way to combine multiple data columns into a single element. 

Protobi properties panel for element Q7 displaying field value 'Q7_1,Q7_2' alongside bar chart showing open-ended responses like 'A bit confusing for the elderly' (1.0%) and other patient feedback about medical device.

Element attribute

You can specify another element as the data source using the element attribute. This takes the final post-calculation value from element as the starting value for another element. This can be an effective way to create hierarchical codes, using the coded values from one element as the input to a higher level code frame.

Protobi interface displaying two derived elements from Q7: Q7_recoded showing thematic codes like #EASY TO USE (42.0%) and #GOOD (19.0%), and Q7_recoded2 showing sentiment categories with #POSITIVE SENTIMENT (78.0%) and #NEGATIVE SENTIMENT (23.0%). Properties panel shows type='(default)' and element='Q7_recoded'.

The values in Q7_recoded2 are the already recoded values from Q7_recoded. I then recoded the existing codeframe into broader sentiment categories. 

Protobi code editor displaying two-column layout with Codes section listing #POSITIVE SENTIMENT (5), #COST EFFECTIVE, #DOSE INDICATOR, #EASY TO USE, #ECO-FRIENDLY, #GOOD under collapsible groups, and Uncoded values section showing (uncoded) 1 and #OTHER entries.

Transform attribute

You can use the Calculate/Transform dialog to create a new value for parent elements. 

A parent element is a group of elements instead of a single element.

Protobi split view displaying Q7 parent question 'What are your initial thoughts about the device you have just reviewed?' with two child text boxes: Q7_1 (Text box 1) showing responses like 'good' (3.3%) and 'Good. Positive' (1.7%), and Q7_2 (Text box 2) showing responses like 'interesting, should be easy to use' (2.5%).

For Q7 we can choose to transform the group to "Condense" which combines values from both child elements (Q7_1, Q7_2) into the parent's distribution. This is similar to setting field to an array of values except heritable properties apply to children but not fields. 

Protobi Transform group dialog overlaying Q7 verbatim responses, with radio button selection for Condense ('squish' ---) option and green checkmark next to 'Hide children' checkbox, demonstrating how to aggregate child text box elements.