Create a new element

Create a new element in the project view

To add a new element, simply press on the plus sign within any tab to create a new element. 

Report view showing a pie chart of practitioner specialties (60% General Practitioner, 40% Practice Nurse) and a bar chart of device reviews by S1, with an empty drop zone at the bottom featuring a blue tooltip labeled "Move or create an element here" and a plus icon. Modal dialog titled "Add an element" with instructional text "Enter a new key to create a new element, or the key of an existing element to mirror it here:" and a text input field showing "new_element" with Cancel and Ok buttons at the bottom.

Result:

The Report now displays three chart elements: the original Pie chart (Sample overview), Bar chart (by S1), and a newly added element titled "new_element" showing a blue horizontal bar at 100% with [NA] label and N value of 100.

Add data to your new element using field

Once you create the new element you can use field to pull data into the element. See How elements get their data: field, element and transform to learn more.

Properties dialog titled "More properties" with a help icon, displaying configuration fields for the new_element: key field shows "new_element", displayKey/headline/title/footnote fields all show "text", type dropdown is set to "(default)", and field is set to "S1".

Create a new element in data process

You can create a new element in the data without manually adding a new element to the project view. 

Add a data process and include code that defines your new column. Below are two different examples, one to create a sum column and another to create a variable based off existing data.

Example code

rows.forEach(function(row) {
    //Create sum column
    row.Q2_sum = (+row.Q2_1) + (+row.Q2_2) + (+row.Q2_3)	

    //Create variable based off logic
    if (row.S14 == 2 || row.S14 == 3) row.awareness = "Aware"
    else row.awareness = "Not aware"
});

Delete

After you run the code, and reload the project all new columns appear as elements in the Fields tab.

The Protobi interface shows the left sidebar Elements panel with sections like Screener, Report, Question Types, and Banners, while the main area displays the Fields tab containing field buttons for "Survey completion date", "iterationid", "respid", "Q2_sum", and "awareness", with a bar chart below showing awareness data (40% Not aware, 60% Aware, N=100).