listCards( )
Deprecated. This function is being discontinued in the upcoming months. We are working to provide alternatives, and we'll provide timely updates before implementing any changes. We understand that this transition might present challenges, and we appreciate your patience and understanding.
Description
Retrieves a list of a workflow's cards.
The listCards()
function returns a Promise that resolves to a list of the
the specified workflow's cards.
Use the options
parameter to specify which cards to retrieve and in which
order to retrieve them. Must use either phaseId
or fetchOnlyArchived
.
Cards can be sorted based on their "id"
, "name"
,
"phaseId"
, "createdDate"
, "updatedDate"
, "source"
, and "position"
.
If no limit
parameter is passed, the first 50 cards are returned. Sort order
defaults to by "phaseId"
and then by "position"
ascending.
This function requires you to specify the ID of a workflow. To learn about retrieving IDs in the Workflow API, see Retrieving IDs.
Syntax
function listCards(workflowId: string, options: ListCardOptions): Promise<CardList>
listCards Parameters
NAME
TYPE
DESCRIPTION
ID of the workflow to retrieve cards from.
Options to use when retrieving the list of cards.
Returns
Fulfilled - List of retrieved cards.
Return Type:
NAME
TYPE
DESCRIPTION
List of cards matching the list options.
Number of items in the current results page.
Total number of cards in the specified workflow and phase.
Number of items returned per page with the current list options.
Total number of results pages.
Index of the current page. Indices are zero-based.
Was this helpful?
Get a list of cards
1import { Permissions, webMethod } from 'wix-web-module';2import { workflows } from 'wix-crm-backend';34export const listCards = webMethod(Permissions.Anyone, (workflowId, phaseId) => {5 return workflows.listCards(6 workflowId,7 {8 "phaseId": phaseId,9 "limit": 2,10 "skip": 10,11 "order": {12 "field": "name",13 "sort": "asc"14 }15 });16});1718/* Returns a promise that resolves to:19 * {20 * "items": [21 * {22 * "createdDate": "2019-05-21T12:21:10Z",23 * "updatedDate": "2019-05-21T12:21:10Z",24 * "name": "This is a card",25 * "id": "5ae263d5-0fdc-4378-9172-655d010cc6d1",26 * "contactId": "c4d0545b-f748-4e1f-93fb-6d8609fb2fb4",27 * "phaseId": "15bc7a80-5500-4445-9c90-adc0ff1b25ac",28 * "source": "Inbox",29 * },30 * {31 * "createdDate": "2019-05-21T12:21:10Z",32 * "updatedDate": "2019-05-21T12:21:10Z",33 * "name": "This is another card",34 * "id": "63d55ae2-9172-0fdc-4378-10cc6d1655d0",35 * "contactId": "c4d0545b-f748-4e1f-93fb-6d8609fb2fb4",36 * "phaseId": "25bc7a80-5500-4445-9c90-adc0ff1b25ac",37 * "source": "Wix Forms",38 * }39 * ],40 * "length": 2,41 * "totalCount": 100,42 * "pageSize": 2,43 * "totalPages": 50,44 * "currentPage": 545 * }46 */