Group and retrieve data
You can use Scaffolding macros to group data, and then, retrieve it.
Ingredients
Apps | Scaffolding |
|---|---|
Macros | Group Data, List Data, Text Data |
Step 1 - Group data
Create a Group Data macro and name it
HRperson.Inside the Group Data macro, create a 2x3 table with
Name,Title, andPositionheaders in the first column.
Add the following details to the second column:
Text Data macro in the first row with Field Name set to
nameand Content Type set totextList Data macro in the second row with Field Name set to
jobtitleText Data macro in the third row with Field Name set to
positionand Content Type set totext
Add three List Option macros in the List Data macro. Add Value and Label of
Mr,Mrs, andMs, respectively, to each List Option macro.
Repeat steps 1 to 4 to create another set of macros. Change the Group Data name to
ITpersonwhile keeping the rest of the properties the same for all the macros as shown in the image below.
Step 2: - Retrieve data
Collect all the data from the macros we created before and compile them into one place.
Create a table with column headers
Title,Name, andPosition.
Add six Get Data macros; one macro for each empty cell.
Enter an appropriate Field Name value with the format of
<groupName>.<dataName>for each macro.
For example, in the first cell, you can useHRperson.jobtitle(based on the title and group name you provided in the above steps).
Save the page.
Click Edit Contents and enter some information in the form.
Publish the content in the form.
Notes
When defining Get Data, use <groupName>.<dataName> for the name parameter.
Result