In addition to configuring mappings for the individual fields of the record running the Smart Form, you can also loop through information on items in the Related List of the running record. As an example, Work Order Line Item is a Related List on the Work Order Object, and you can have more than one Work Order Line Item per Work Order. Loops allow you to iterate through a Work Order's Work Order Line Item records, accessing the fields you choose for each record. 


You can create your own Related List Object, but in this case Work Order Line Item will be the example as it is a Standard Object. 



Create a Loop Element 


1. Create a Loop Element that encapsulates Elements that will map to the fields you want to access for each Work Order Line Item record. 



For more information on configuring Loop Elements in the Designer, please see this article for details: Configuring Loops


2. Navigate to the Mapping tab of the Loop's Element Edit Properties Window and define Data Mapping.



FieldFunction 
Field Mapping References the Related Object's API Name (please see here for more information: Using the Mapping Lookup Tool)
Data ActionFor more information, please see: Smart Form Data Actions for Element Mapping
Relationship Field nameAPI Name of the field that relates Work Order Line Item to Work Order as shown below (Master-Detail or Lookup relationship)


    

Optionally, you can also configure SOQL statements to filter the results of the Loop and set the order by which the Related List records should be iterated through. For more information on Salesforce's Object Query Language, please see this article: Salesforce Object Query Language (SOQL)



Here, only Work Order Line Items with the Status 'New' will be looped through, and the Work Order Line Items will loop through in numerical order ascending.


In the above example Status record information needs to be available for the above query to function. This is most easily achieved by having an Text Element field mapped to the Status field within the body of the Loop.


3. Save your changes.