Working with SubForm Element Data
When you use the SubForm component, you've effectively created a relational database design and a one-to-many relationship between the parent form and the child form. This is great a way to allow unlimited child items per form, or break up a long form, but it does leave you with your data spread across two database tables.
This article explains how to output/use the data collected through:
- A PDF, Autoresponder or Notification using Lookup Data
- Using a Workflow > Drill Down Page
- The Database Browser/Submission Bin
- The Data Export Wizard
Using Lookup Data to Join the data together New
You can use Lookup Data (available for Dynamic PDFs, Autoresponder, and Notifications) on the parent form, to pull in all the records from the SubForm and output them in what we call a Repeating Region. Repeating Regions are explained in more detail here. When creating a Lookup Data rule to pull in the SubForm's child records, you'll want to use the ParentRecordID_for_[name] in the SubForm in the Lookup Data rule as shown below:
Output using a Workflow > Drill Down Page Recommended
You can easily link the two database tables together using a Relational Workflow and a Drill Down Page. This would allow you to view all the parent form entries, click on any row and view all the child rows. You can even show the child rows in a lightbox or an embedded drill down page.
First, use the WorkFlow Wizard to generate a web portal with the data from your parent form. Next add a Drill Down Page, select your SubForm and configure the rule as shown below, selecting the ParentRecordID_for_[name] on the left and the parentRecord.RecordID (the parent of the drill Down Page) on the right.
Once your Drill Dow page is created, refer to this video tutorial for details on how to add a linl to the parent page to "drill down" to view the related records
Database Browser/Submission Bin Using a Related Data View
Access the parent form (the form that has the subform) and open the Database Browser. From here, you can create a Data View to show the parent data and the related child (subform) data.
- Click Create & Manage Views from the Data Display View menu
- Step through the settings until you get to the "Include Relational Data" question. Click "Include Relational Data" and click next
- Choose the linked form (your subform) in the Related DataSource property
- Next, add the lookup rule. Click the Relationship Rules button and configure the lookup rule. On the left, select the field from your subform that has a reference to the parent forms record_id, ParentRecordID_for_[name], and on the rigth select RecordID. This will associate the child records with the parent record.
- Click through and configure the other settings, see Data Views for details on the available settings.
After you save and return to the Database view, choose the new view from the Data Display View menu, them click any row to see the related records from the child subform loaded into the split pane display.
Note
The related records are read-only from this view. .Export Data Wizard
You can also export the data to Excel or CSV via the Export Data Wizard. You'll need to export the data from both the parent form and the SubForm and use the Parent Form RecordID > SubForm ParentRecordID_for_[name] to join/link the relational data together.
0 Comments