As well as using Loops to iterate over information for a Related List directly related to the Object running the Smart Form (e.g. Work Order Line Item), it is also possible to configure the same with a Related List that falls further down the Object Tree via Lookup Objects


The process to setup the Loop Element and its encapsulated elements is the same as when the Related List is directly related to the Object running the Smart Form, apart from the mapping syntax which will be covered later in this article.


Please see this article for more information on how to setup the elements to map between Loops and Related Lists: Mapping between Loops and Related Lists

See More/Less...

Please see this article for more information on how to use the Mapping Lookup tool to insert a pre-formatted lookup path: Mapping an Element with the Mapping Lookup tool



Example: Contacts Related List


As an example, the Contacts Related List can be accessed via the Account Lookup Field on the Work Order Object. Please see the diagram below illustrating how the Contact records are reached. 

After the Related Object List (Contacts), you cannot go on to reference an Object connected to that Related List (Contacts). There is no limit to the amount of Lookup Objects you reference before the Related List, however, please ensure that the syncing scope configured for your Org can accommodate this. 


Configure the Field Mapping for the Loop Element


Using the Mapping Lookup tool, the syntax for the Loop Element's Field Mapping should include the full path to get from the Object record running the form to the Related List you would like to access. In this case that would be Work Order, Account and then Contacts (the Objects in the orange boxes).





Remember to use the plural Object Name when referencing the Related List to signify the one-to-many relationship. 


Configure the Field Mapping for the Elements Inside the Loop


Using the Mapping Lookup tool, the Field Mapping for elements inside the Loop should start with the parent Lookup Object, then the Related List Object, and end with the Field you would like to access for the Related Object. In this case, that would mean Account, the Contacts Related List, and then the Name Field. 





Configure the Relationship Field Name for the Loop Element


The Relationship Field name for the Loop Element should be the API Name of the field that connects the Related Object to its parent Object (see diagram above)