Overview
In this article, we are going to provide a brief overview of the charts used to visually represent how objects are nested and accessed within your Documents and Canned Emails. By understanding how to utilize these charts, you will have the information necessary to access any tag within your system.
Understanding The Object Chart
It is essential to understand that access to tags is dependent on what Document or Email type you are currently working within. These differences are reflected within their charts. All the object charts can be found from the links provided below.
For the duration of this article, we will be focusing on the Invoice document chart as an example. You can view the full chart here.
Root Models
The Root Models column displays the objects that are initially accessible. We do not need to use looping or chaining to gain access to these objects. Within the Invoice Document chart, we can see that the Report Meta and Orders objects are both initially accessible under the Root Models. You can find the documentation for how to access these tags below.
Root Models | Objects Available | Link to Object Tags | ||
Report Meta | ... | |||
Orders | ... | |||
... | ... | |||
... | ... | ... | ... |
Objects Available
The Objects Available columns show the additional objects that are accessible under the Root Models. These objects can be accessed through a combination of looping and chaining from their parent object. In our Invoice Document chart, you can see that BillingLocation, Contact, and Customers are all accessible under Orders. Additionally, the AccountsPayable object is accessed under the Customer object. You can view a full list of what is accessible here.
Root Models | Objects Available | Link to Object Tags | ||
Report Meta | ... | |||
Orders | ... | |||
Billing Location | ... | |||
Contact | ... | |||
Tags | ... | |||
... | ... | |||
Customers | ... | |||
Accounts Payable | ... | |||
Tags | ... | |||
... | ... | |||
... | ... | ... |
Link to Object Tags
The last column in the object charts is the Link to Object Tags. These links point towards the object's accessible tags and nested objects. These links are an essential part of accessing the tags you need as they show what tags and nested objects are available and how to access them.
Root Models | Objects Available | Link to Object Tags | ||
Report Meta | Report Meta Tags | |||
Orders | Order Tags | |||
Billing Location | Location Tags | |||
Contact | Contact Tags | |||
Tags | N/A | |||
... | ... | |||
... | ... | ... |
Accessing these tags can be broken down into two steps outlined below.
Accessing Tags Formula
Initial Step: Finding The Appropriate Chart
As mentioned above, in order to access tags within your documents and canned emails, you must be using the chart that corresponds to that document or canned email.
Recursive Step: Find The Desired Tag or Nest Deeper From The Current Object
Assuming you are following the correct chart, the next step is to find the link for the currently accessible object and access the nested object or desired tag. The initial object will always be one of the Root Models objects. If the tag you want is accessible at the current object, the process stops here. If you are reaching a nested object, repeat this step until you reach the desired tag.
Helpful hint: It will be much easier to find a nested object tag by testing that you are in fact accessing the current object by pointing to the id of the object first, seeing if the tag appears, and then nesting deeper. Doing so will ensure you are fixing any syntax or semantics errors before moving forward.
Accessing Tags Examples
Below we are going to display a few sample code snippets that display how each object is nested and accessed. Feel free to copy the snippets below into an Invoice Document and test out different tag combinations. Once you feel confident in how tags are accessed, you will now have the knowledge to access any tag you desire. Note that you will need to reference the full Invoice Document Chart to understand how these tags are being accessed.
HTML Markup
<!-- Report Meta (Root Model) Tags --> Todays Date: {{Today}} <br/> Site Owners Name: {{SiteOwner.Name}} <br/><br/> <!-- Orders (Root Model) Tags--> <!-- {{#each Orders}} --> Billing Address: {{BillingLocation.Address}} <br/> Customers Name: {{Customer.Name}} <br/> Customers Accounts Payable Id: {{Customer.AccountsPayable.Id}} <br/><br/> <!-- {{#each InvoiceNotes}} --> Notes: {{Notes}} <br/> <!-- {{/each}} --> <!-- {{/each}} -->
Result
Today's Date: 2020-01-24T09:18:02:6359019 Site Owners Name: John Smith Billing Address: 21695 Cassie St Customers Name: Dave Miller Customers Accounts Payable Id: c8ead33d-09cc-ac34-99768caccd Notes: Lorem ipsum dolorem ipsum porro vel. Notes: Fugiat vel lavore.
If you have any additional questions, feel free to reference the FAQ or reach out to our support team for further guidance.