Creating grid cards
A grid card displays different points of data in a grid
format. You can use this card to highlight specific data.
About this task
- Tooltip
- A tooltip provides extra details about the data that is displayed on the card.
- Card title
- A unique label or heading assigned to the card.
- Value label
- A unique label assigned to the values that are derived by a query.
- Footer link
- A clickable field or link with a label, for example,
View all
.
Procedure
On the General tab, define the card:
On the Data tab, add data to the card:
On the Style tab, define the style of the card:
Example
For a grid card, any attribute that is returned by a query can be
displayed. The query includes a tenantId
variable.
query OrderDetail($tenantId: String, $orderId: String) {
orderDetails: businessObjects(
hint: {viewId: "graph"}
simpleFilter: {tenantId: $tenantId, type: Order}
advancedFilter: {AND: [{EQUALS: [{SELECT: "orderType", type: STRING}, {VALUE: "INBOUND", type: STRING}]}, {EQUALS: [{SELECT: "id", type: STRING}, {VALUE: $orderId, type: STRING}]}]}
) {
edges {
object {
... on Order {
orderIdentifier
buyer {
id
name
organizationIdentifier
}
vendor {
id
name
organizationIdentifier
}
shipFromInstructionLocation {
locationName
locationIdentifier
}
shipToLocation {
locationName
locationIdentifier
}
orderType
orderStatus
deliveryStatusByDate
shipmentStatusByDate
createdDate
requestedShipDate
plannedShipDate
lineCount
requestedDeliveryDate
quantity
plannedDeliveryDelay
estimatedDeliveryDelay
quantityUnits
totalValue
actualDeliveredDelay
orderValueCurrency
requestedShipDate
sourceLink
totalShippedQuantity
actualShipDelay
}
}
}
}
}
The following code is an example of how to define the variables to use in the query.
{
"tenantId": "{{ tenantId }}",
"orderId": "fa15029f-9ef8-432f-93de-1e48fd8bcda3"
}
The following code is an example of the data that is returned by the query.
{
"data": {
"orderDetails": {
"edges": [
{
"object": {
"orderIdentifier": "1000567497",
"buyer": {
"id": "d2eb6aaf-6951-463d-9072-2963bb251123",
"name": "LightTree",
"organizationIdentifier": "LightTree",
"__typename": "Organization"
},
"vendor": {
"id": "2c50b311-ffb7-48d4-9194-c6dbab6b5dbc",
"name": "Interalloy Corporation",
"organizationIdentifier": "Interalloy",
"__typename": "Organization"
},
"shipFromInstructionLocation": {
"locationName": "Interalloy Corporation - Bozeman",
"locationIdentifier": "Interalloy - Bozeman",
"__typename": "Location"
},
"shipToLocation": {
"locationName": "LightTree Plant 1 Birmingham",
"locationIdentifier": "LT-1",
"__typename": "Location"
},
"orderType": "INBOUND",
"orderStatus": null,
"deliveryStatusByDate": "NOT_DELIVERED",
"shipmentStatusByDate": "FULLY_SHIPPED",
"createdDate": "2021-07-15T00:00:00.000Z",
"requestedShipDate": "2021-07-22T00:00:00.000Z",
"plannedShipDate": "2021-07-21T00:00:00.000Z",
"lineCount": 1,
"requestedDeliveryDate": "2021-07-26T00:00:00.000Z",
"quantity": 44,
"plannedDeliveryDelay": null,
"estimatedDeliveryDelay": -24,
"quantityUnits": "EA",
"totalValue": 132,
"actualDeliveredDelay": null,
"orderValueCurrency": "USD",
"sourceLink": "http://lighttree.com/1000567497",
"totalShippedQuantity": null,
"actualShipDelay": 48,
"__typename": "Order"
},
"__typename": "BusinessObjectEdge"
}
],
"__typename": "BusinessObjectsCursor"
}
},
"loading": false,
"networkStatus": 7
}
The following code is an example of the transformation that is applied to the data.
The attributes that are chosen must match what is returned from the data. Any calculation can be
performed on the data that is returned. In the following example, some checks are done to modify
what is shown in the Customer
and Supplier
fields.
{
"errors": "{{#? this.errors}}",
"results": {
"{{#each data.orderDetails.edges}}": {
"orderIdentifier": "{{this.object.orderIdentifier}}",
"lineCount": "{{this.object.lineCount}}",
"quantityUnits": "{{this.object.quantityUnits}}",
"shipToLocation": "{{this.object.shipToLocation.locationName}}",
"estimatedDeliveryDelay": "{{this.object.estimatedDeliveryDelay}}",
"requestedDeliveryDate": "{{this.object.requestedDeliveryDate}}",
"orderType": "{{this.object.orderType}}",
"deliveryStatusByDate": "{{this.object.deliveryStatusByDate}}",
"totalValue": "{{this.object.totalValue}}",
"createdDate": "{{this.object.createdDate}}",
"actualDeliveredDelay": "{{this.object.actualDeliveredDelay}}",
"orderValueCurrency": "{{this.object.orderValueCurrency}}",
"requestedShipDate": "{{this.object.requestedShipDate}}",
"sourceLink": "{{this.object.sourceLink }}",
"quantity": "{{this.object.quantity }}",
"totalShippedQuantity": "{{this.object.totalShippedQuantity}}",
"actualShipDelay": "{{this.object.actualShipDelay}}",
"shipmentStatusByDate": "{{this.object.shipmentStatusByDate}}",
"plannedDeliveryDelay": "{{this.object.plannedDeliveryDelay}}",
"shipFromLocation": "{{this.object.shipFromInstructionLocation.locationName}}",
"customerId": "{{#? this.object.buyer.id }}",
"customerTemplateLink": "DEFAULT_CUSTOMER_DETAIL_LAYOUT_TEMPLATE",
"supplierTemplateLink": "DEFAULT_SUPPLIER_DETAIL_LAYOUT_TEMPLATE",
"supplierId": "{{#? this.object.vendor.id}}",
"Customer": [
{
"{{#if (this.object.buyer.organizationIdentifier && this.object.buyer.name)}}": "{{this.object.buyer.organizationIdentifier}}, {{this.object.buyer.name}}"
},
{
"{{#elseif this.object.buyer.organizationIdentifier}}": "{{this.object.buyer.organizationIdentifier}}"
},
{
"{{#elseif this.buyer.name}}": "{{this.object.buyer.name}}"
},
{
"{{#else}}": "--"
}
],
"Supplier": [
{
"{{#if (this.object.vendor.organizationIdentifier && this.object.vendor.name)}}": "{{this.object.vendor.organizationIdentifier}}, {{this.object.vendor.name}}"
},
{
"{{#elseif this.object.vendor.organizationIdentifier}}": "{{this.object.vendor.organizationIdentifier}}"
},
{
"{{#elseif this.object.vendor.name}}": "{{this.object.vendor.name}}"
},
{
"{{#else}}": "--"
}
]
}
}
}
What to do next
Add the card to a page by using the Page builder.