> For the complete documentation index, see [llms.txt](https://docs.gridmate.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gridmate.io/package-reference/components-library/flow-grids/gm-flow-card-grid.md).

# GM - Flow Card Grid

(gmpkg:FlowCardGridComponent)

## **Documentation**

**GM - Flow Card Grid** component is used to select records from a list of responsive cards inside a screen flow. Each card displays a record using a record layout; clicking a card checks it, clicking it again unchecks it. The selection can be limited to a single record and can be made required before the user moves to the next screen.

**Use case:** Display the contacts of the current account as cards in a screen flow, so the user can pick the contacts to include. See [Flow Tutorial](https://docs.gridmate.io/product-tour/grids/smart-grids-in-flows.md).

## **Specification**

The following properties use JSON syntax as part of their configuration: **Candidates, Filter, Record Layout.**

<table data-full-width="true"><thead><tr><th width="244">Property</th><th width="131.33333333333331">Type</th><th width="459.94877115885424">Description</th></tr></thead><tbody><tr><td>01. recordId</td><td>String</td><td>recordId to use. Keep this empty if you want to use the current record. The value replaces <strong>$recordId</strong> in the <strong>Filter</strong> property.</td></tr><tr><td>02. Related Object Name *</td><td>String</td><td>The API name of the object to display. Ex. Contact. Don’t forget __c for custom objects.</td></tr><tr><td>03. Required</td><td>Boolean</td><td>Check this option to make a record selection required before moving to the next step.</td></tr><tr><td>04. Single Record Selection</td><td>Boolean</td><td>Check this option to allow the selection of a single record only. Selecting a card unselects the previously selected one.</td></tr><tr><td>05. Selected Id(s)</td><td>String Collection</td><td>The list of selected record Ids. Use it as an output to get the user selection. Set this property only if you want to preselect records.</td></tr><tr><td>06. Selected Id</td><td>String</td><td>The selected record Id. Use it as an output to get the user selection. This property is valid only if <strong>Single Record Selection</strong> is checked.</td></tr><tr><td>07. Candidates</td><td>String</td><td>The list of records to display. The collection should be a JSON string (array of records with an <strong>Id</strong>). See <a href="https://docs.gridmate.io/product-tour/grids/smart-grids-in-flows.md">Flow Tutorial</a>. Only the list of Id(s) is used to get the records. When a <strong>Filter</strong> is also defined, both conditions are applied.</td></tr><tr><td>08. Filter</td><td>String</td><td>JSON string to define filter criteria. Don’t forget __c for custom fields. <strong>$recordId</strong> can be used to reference the current recordId. Ex. <code>{"AccountId":"$recordId"}</code>. See <a href="https://docs.gridmate.io/package-reference/components-library/grids/gm-relatedlist-grid.md#specification">GM - RelatedList Grid</a></td></tr><tr><td>09. Sort</td><td>String</td><td>The field list to sort the cards. Don’t forget __c for custom fields.</td></tr><tr><td>10. Order</td><td>String</td><td>Ascending or descending order for sorting. For ascending enter the value asc. For descending enter the value desc</td></tr><tr><td>11. Row Limit</td><td>Integer</td><td>The maximum number of records to fetch. The default value is 100. Values above 100 are capped at 100.</td></tr><tr><td>12. Grid Width</td><td>Integer</td><td>Set the grid width in %. The default value is 100.</td></tr><tr><td>13. Grid Height</td><td>Integer</td><td>Set the grid height in px. Set this property if you want to control the height. The user has to scroll vertically to see more cards.</td></tr><tr><td>14. Large Layout</td><td>Integer</td><td>Number of cards per row on large devices. Use a divisor of 12: 1, 2, 3, 4, 6 or 12.</td></tr><tr><td>15. Medium Layout</td><td>Integer</td><td>Number of cards per row on medium devices. Use a divisor of 12: 1, 2, 3, 4, 6 or 12.</td></tr><tr><td>16. Small Layout</td><td>Integer</td><td>Number of cards per row on small devices. Use a divisor of 12: 1, 2, 3, 4, 6 or 12.</td></tr><tr><td>17. Title Field</td><td>String</td><td>The field displayed as the card title. The card header is displayed only when this property is set.</td></tr><tr><td>18. Record Layout</td><td>String</td><td>JSON record layout used to render each card body. The syntax is the same as the <strong>Record Layout</strong> property of <a href="https://docs.gridmate.io/package-reference/components-library/records/gm-record-layout-lwc.md">GM - Record Layout (LWC)</a>.</td></tr><tr><td>19. Card Icon</td><td>String</td><td>The icon displayed in the card header. All lightning icons are supported. You can get the icon name from <a href="https://lightningdesignsystem.com/icons/">https://lightningdesignsystem.com/icons<strong>/</strong></a></td></tr><tr><td>20. Show Card Border</td><td>Boolean</td><td>Check this option if you wish to add a border to each card.</td></tr></tbody></table>

## **API Reference**

{% tabs fullWidth="true" %}
{% tab title="FlowCardGridComponent.design" %}

```xml
<design:component label="GM - Flow Card Grid">
    <design:attribute name="recordId" label="01. recordId" 
                      description="recordId to use. Keep this empty if you want to use the current record"/>        
    <design:attribute name="relatedObjectName" label="02. Related Object Name" 
                      description="The name of the related object to display. Ex. Opportunity"/>    

    <design:attribute name="required" label="03. Required" 
                      description="Set the selection as required"/>                
    <design:attribute name="singleRecord" label="04. Single Record Selection" 
                      description="Single record selection only"/>                               

    <design:attribute name="selectedIds" label="05. Selected Id(s)" 
                      description="The list of selected id(s)"/>           
    <design:attribute name="selectedId" label="06. Selected Id" 
                      description="Selected record id"/>                                     

    <design:attribute name="candidates" label="07. Candidates" 
                      description="The list of candidates to display"/>    
    <design:attribute name="filter" label="08. Filter" 
                      description="Json string to define filter criteria. Don’t forget __c for custom fields. Ex. {'StageName':'Needs Analysis'} to see only 'Needs Analysis' Opportunities"/>    
    <design:attribute name="sort" label="09. Sort" 
                      description="The field list to sort the data grid. This field is used only for the initial load. Don’t forget __c for custom fields. Ex. Amount to sort opportunities by amount"/>
    <design:attribute name="order" label="10. Order" 
                      description="Asc or Desc order for sorting"/>         
    <design:attribute name="rowLimit" label="11. Row Limit" 
                      description="The maximum number of row to fetch"/>     

    <design:attribute name="width" label="12. Grid Width" 
                      description="Set the grid width in %"/>  
    <design:attribute name="height" label="13. Grid Height" 
                      description="Set the grid height in px"/>

    <design:attribute name="largeLayout" label="14. Large Layout" 
                      description="Set # of columns for large devices"/>
    <design:attribute name="mediumLayout" label="15. Medium Layout" 
                      description="Set # of columns for medium devices"/>                  
    <design:attribute name="smallLayout" label="16. Small Layout" 
                      description="Set # of columns for small devices"/>                  

    <design:attribute name="titleField" label="17. Title Field" 
                      description="Title Field for the card title "/>    
    <design:attribute name="recordLayout" label="18. Record Layout" 
                      description="JSON Record Layout"/>        

    <design:attribute name="cardIcon" label="19. Card Icon" 
                      description="Card Icon"/>                      
    <design:attribute name="showCardBorder" label="20. Show Card Border" 
                      description="Show Card Border"/>                      
</design:component>
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.gridmate.io/package-reference/components-library/flow-grids/gm-flow-card-grid.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
