Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Live template
templateTypetemplate
templateOption{"label":"StepbyStep Guide cloud ready","value":"477609390","templateType":"template"}
templateTypeOption{"label":"Confluence template/blueprint","value":"template"}
templateId477609390
excerptData stored in table fields created with the Table Data macro can be accessed and displayed with the Get Data macro. In this example, we will create a simple table that stores the names of staff members who are currently involved in a project and also what roles they hold in that project. The example then uses two Get Data macros to retrieve data from the table so that we can form a sentence that says: "This project has <STAFF NAME> and their role is <STAFF ROLE>." Ingredients Apps Scaffolding Macros Get Data, Table Data, Text Data Guide create a Table Data macro set the Name parameter to " table " Within the Table Data macro create a table using the Editor tools Inside the empty cell under the " Name " column create a Text Data macro set the Field Name parameter to " tableName " change the Type parameter to line change the Content Type parameter to text Inside the empty cell under the " Role " column create a Text Data macro set the Field Name parameter to " tableRole " change the Type parameter to line change the Content Type parameter to text You should now have a Table Data macro that looks like this: Save the page On the saved page choose Edit Contents button so that we can start populating the table we just created with names and roles Here’s an example. Once you are done choose Save We now have a table with data. We can use the Get Data macro to retrieve the data and build a sentence using the names and roles from the table. In the editor under the Table Data macro write the following phrase " This project has " Immediately after that phrase create a Get Data macro set the Field Name parameter to " table.0.tableName " This means we are calling the " tableName " field name from the first row (" 0 ") in the Table Data macro named " table ". Immediately after that Get Data macro type

...

in the following phrase " and their role is " Immediately after that phrase create a Get Data macro set the Field Name parameter to " table.0.tableRole” This means we are calling the " tableRole " field name from the first row (" 0 ") in the Table Data macro named " table ". You should now have a collection of two Get Data macros that look like this in your Confluence editor. Save the page check the results Notes The first row has a number of 0 for example, table.0.text accesses the first row of table.text Result
fieldGroupKeys{"si61t55hmx":["net.customware.confluence.plugin.scaffolding__si61t55hmx__data_0_tx6n5zbbc1"]}