cases

This component fetches Cases from the CRM, either owned by the logged-in user or for all customer Cases.

{% component type: "cases" %}

Parameters and Options

Parameter Values Required Description
type cases

This is the name of the entity that needs to be used for the component retrieving function.

layout <Your Layout name>
Path to file that will contain the Liquid layout content to be parsed.

If an empty string, nothing will be rendered.
If paramater is not included, the default virtual layout will be rendered (see below).

currentMemberOnly true (default)
false

By default (true) retrieves Cases from the logged in user only. If false retrieves Cases for all CRM contacts.
filterBy Id (default)
FormId
MemberId
FormName
DateSubmission

The name of the property to filter by. If empty or not present, no filtering will be used.

Remove spaces from custom property names here.

filterValue <your value>
Your specific value to filter by, eg: name, id, number, date, etc.
Liquid variables can be used here also. If present but no value set, no items will be returned.
sortBy Id (default)
FormId
MemberId
FormName
DateSubmission

The name of the property to sort by. If empty or not present, alpha/numeric sorting will be used.

Remove spaces from custom property names here.

sortOrder ASC
DESC (default)

ASC sorts the items in ascending order while DESC sorts in descending order (based on alpha/numeric or date sorting).
If empty or not present, alpha/numeric sorting will be used.
object item
collection (default)

Determines the method for Liquid rendering.
item returns each item iteratively, one after another, for output (generally, output to a container element with no need for looping through the data).
collection returns all items as one collection for output (your container element and looping logic would be handled in the Components Layout).
collectionVariable <yourLiquidVariableName>
Assigns the data to a Liquid collection enabling further access to the data on the Page or Template using Liquid.

Your collectionVariable value must only contain English letters, numbers or underscores. Spaces or special characters are not supported.

Liquid Output

The below example has 5 sample items (due to a filter applied) but is otherwise the default structure you will get from this Component.

{
  "items": [
  {
    "formName": "Checkout",
    "id": 186,
    "formId": 13,
    "memberId": 35,
    "dateSubmission": "2020-05-12T14:00:57.367",
    "fields": [
      {
        "Name": "Email",
        "Alias": "Email",
        "Value": "testt3606@gmail.com",
        "Type": "String"
      },
      {
        "Name": "First Name",
        "Alias": "FirstName",
        "Value": "Test",
        "Type": "String"
      },
      {
        "Name": "Last Name",
        "Alias": "LastName",
        "Value": "Test",
        "Type": "String"
      },
      {
        "Name": "Phone",
        "Alias": "Phone",
        "Value": "2323232323",
        "Type": "String"
      },
      {
        "Name": "Company name",
        "Alias": "CompanyName",
        "Value": "Test Company",
        "Type": "String"
      },
      {
        "Name": "Shipping Address",
        "Alias": "Payment_ShippingAddress",
        "Value": "1 Test Street",
        "Type": "String"
      },
      {
        "Name": "Shipping City",
        "Alias": "Payment_ShippingCity",
        "Value": "Testville",
        "Type": "String"
      },
      {
        "Name": "Shipping State",
        "Alias": "Payment_ShippingState",
        "Value": "LA",
        "Type": "String"
      },
      {
        "Name": "ZipCode",
        "Alias": "Zip_Code",
        "Value": "2323",
        "Type": "String"
      },
      {
        "Name": "Shipping Country",
        "Alias": "Payment_ShippingCountry",
        "Value": "UNITED STATES",
        "Type": "String"
      }
    ]
  },
  {
    "formName": "DEMO AJAX Example",
    "id": 176,
    "formId": 11,
    "memberId": 35,
    "dateSubmission": "2020-04-16T16:05:07.8",
    "fields": [
      {
        "Name": "First Name",
        "Alias": "FirstName",
        "Value": "test",
        "Type": "String"
      },
      {
        "Name": "Last Name",
        "Alias": "LastName",
        "Value": "test",
        "Type": "String"
      },
      {
        "Name": "Email",
        "Alias": "Email",
        "Value": "testt3606@gmail.com",
        "Type": "String"
      },
      {
        "Name": "Not Required",
        "Alias": "NotRequired",
        "Value": "",
        "Type": "String"
      }
    ]
  },
  {
    "formName": "DEMO Contact Form",
    "id": 175,
    "formId": 12,
    "memberId": 35,
    "dateSubmission": "2020-04-16T08:02:15.78",
    "fields": [
      {
        "Name": "First Name",
        "Alias": "FirstName",
        "Value": "test",
        "Type": "String"
      },
      {
        "Name": "Last Name",
        "Alias": "LastName",
        "Value": "test",
        "Type": "String"
      },
      {
        "Name": "Email",
        "Alias": "Email",
        "Value": "testt3606@gmail.com",
        "Type": "String"
      },
      {
        "Name": "Phone",
        "Alias": "Phone",
        "Value": "2323232323",
        "Type": "String"
      },
      {
        "Name": "Enquiry",
        "Alias": "Enquiry",
        "Value": "test",
        "Type": "Multiline"
      }
    ]
  },
  {
    "formName": "DEMO AJAX Example",
    "id": 174,
    "formId": 11,
    "memberId": 35,
    "dateSubmission": "2020-04-14T12:56:21.897",
    "fields": [
      {
        "Name": "First Name",
        "Alias": "FirstName",
        "Value": "test2",
        "Type": "String"
      },
      {
        "Name": "Last Name",
        "Alias": "LastName",
        "Value": "test2",
        "Type": "String"
      },
      {
        "Name": "Email",
        "Alias": "Email",
        "Value": "testt3606@gmail.com",
        "Type": "String"
      },
      {
        "Name": "Not Required",
        "Alias": "NotRequired",
        "Value": "",
        "Type": "String"
      }
    ]
  },
  {
    "formName": "DEMO Contact Form",
    "id": 173,
    "formId": 12,
    "memberId": 35,
    "dateSubmission": "2020-04-02T15:31:27.927",
    "fields": [
      {
        "Name": "First Name",
        "Alias": "FirstName",
        "Value": "test",
        "Type": "String"
      },
      {
        "Name": "Last Name",
        "Alias": "LastName",
        "Value": "test",
        "Type": "String"
      },
      {
        "Name": "Email",
        "Alias": "Email",
        "Value": "testt3606@gmail.com",
        "Type": "String"
      },
      {
        "Name": "Phone",
        "Alias": "Phone",
        "Value": "2323232323",
        "Type": "String"
      },
      {
        "Name": "Enquiry",
        "Alias": "Enquiry",
        "Value": "test",
        "Type": "Multiline"
      }
    ]
  }
]
}

Virtual Layout

Based on the above example, if not using any custom layout or collection, the default virtual layout will output as a summary list of Cases, eg:

<ul>
    {% for item in this.items %}
        <li> 
            <strong>{{item.formName}}</strong>        
            <span>Date Submission: {{item.dateSubmission | format_date: "dddd, MMMM dd, yyyy"}}</span>
        </li>
    {% endfor %}
</ul>

Rendering the list:

  • Checkout Date Submission: Tuesday, May 12, 2020
  • DEMO AJAX Example Date Submission: Thursday, April 16, 2020
  • DEMO Contact Form Date Submission: Thursday, April 16, 2020
  • DEMO AJAX Example Date Submission: Tuesday, April 14, 2020
  • DEMO Contact Form Date Submission: Thursday, April 02, 2020

Accessing the Data

This data is also accessible directly on the Page or Template via a Liquid Collection by adding collectionVariable to the Component.

An example using collectionVariable with value "allCases":

{% component type: "cases", collectionVariable: "allCases" %}

Accessing a specific item within the collection. In this case the third item (zero based index), which in our example would render the value DEMO Contact Form

{{allCases.items[2]['formName']}}


Related Articles

  • Form Submissions
  • {{ workflow }} object
    This liquid object will output the Workflow details of a submitted Form. You can use...
  • orders
    This component fetches Orders from the CRM, either owned by the logged-in user or for all customer Orders.

External Resources

There are currently no external resources available.

Please let us know if you have any other contributions or know of any helpful resources you'd like to see added here.


Questions?

We are always happy to help with any questions you may have.
Send us a message at support@treepl.co and we will consult you as soon as possible.