Currently, the Cases Module component has two options when selecting the View Type, “List” and “Detail”. Any time I have pulled the data, the JSON output is the same on both. (Might be different in some situations I have not used.) I bring this up because I have encountered a few issues while trying to display case data on the front end.
- The Data is hard to display in a simple table or layout without added liquid. As illustrated here. Cases Data Component Output Order Issue - #3 by Rhatch
- The data is not always in the same order.
- This could become a resource issue with large amounts of data.
- When you export the data, the columns do not align with the order of the from properties, as they do in a custom module. (my OCD)
- There is no way to filter from the component tag any custom form fields or system form fields.
- There is no way of sorting from the component tag any custom form fields or system form fields.
Suggestion: Leave the View Type: “Detail” layout as is and change the “List” to output like a custom module.
Here is a sample of the “Detail” layout as found in the docs. cases
{
"Items": [
{
"FormName": "DEMO AJAX Example reCaptcha v3",
"DateSubmission": "2021-08-24T20:20:20.618268",
"CreatedDateTime": "2021-08-24T20:20:20.618268",
"Id": "4598",
"Fields": [
{
"Name": "First Name",
"Alias": "FirstName",
"Type": "String",
"Value": "Alex",
"ArrayValue": [
"Alex"
]
},
{
"Name": "Last Name",
"Alias": "LastName",
"Type": "String",
"Value": "Smith",
"ArrayValue": [
"Smith"
]
}
],
"FormId": "1387",
"OrderId": "0",
"MemberId": "1442"
}
],
"Params": {
"type": "cases",
"collectionvariable": "allCases",
"layout": "",
"filterby": "MemberId",
"filtervalue": "1442",
"limit": "3",
"viewtype": "list"
}
}
I propose that the “List” be structured similarly to most other modules. Shown here in the docs. Component Type: Module (Custom Modules)
Basically, removing the Fields array and bringing the needed data forward.
{
"Items": [
{
"FormName": "DEMO AJAX Example reCaptcha v3",
"DateSubmission": "2021-08-24T20:20:20.618268",
"CreatedDateTime": "2021-08-24T20:20:20.618268",
"Id": "4598",
"FirstName": "Alex",
“LastName": "Smith",
"FormId": "1387",
"OrderId": "0",
"MemberId": "1442"
}
],
"Params": {
"type": "cases",
"collectionvariable": "allCases",
"layout": "",
"filterby": "MemberId",
"filtervalue": "1442",
"limit": "3",
"viewtype": "list"
}
}
Hopefully this makes sense. Would like to hear what other think and how they are using this module.