Search.../

listPhasesInfo( )

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 phases.

The listPhasesInfo() function returns a Promise that resolves to a list containing information about the specified workflow's phases.

Use the options parameter to specify which phases to retrieve and in which order to retrieve them. Phases can be sorted based on their "id", "name", and "position". If no limit parameter is passed, the first 50 cards are returned. Sort order defaults to 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 listPhasesInfo(workflowId: string, [options: ListOptions]): Promise<PhaseList>

listPhasesInfo Parameters

NAME
TYPE
DESCRIPTION
workflowId
string

ID of the workflow to retrieve phases from.

options
Optional
ListOptions

Options to use when retrieving the list of phases.

Returns

Fulfilled - List of retrieved phases.

Return Type:

Promise<PhaseList>
NAME
TYPE
DESCRIPTION
items
Array<Phase>

List of phases matching the list options.

length
number

Number of items in the current results page.

totalCount
number

Total number of phases in the specified workflow.

pageSize
number

Number of items returned per page with the current list options.

totalPages
number

Total number of results pages.

currentPage
number

Index of the current page. Indices are zero-based.

Was this helpful?

Get a list of phases info

Copy Code
1import { Permissions, webMethod } from 'wix-web-module';
2import { workflows } from 'wix-crm-backend';
3
4export const listPhasesInfo = webMethod(Permissions.Anyone, (workflowId) => {
5 return workflows.listPhasesInfo(
6 workflowId,
7 {
8 "limit": 2,
9 "skip": 10,
10 "order": {
11 "field": "name",
12 "sort": "asc"
13 }
14 }
15 );
16});
17
18/* Returns a promise that resolves to:
19 * {
20 * "items": [
21 * {
22 * "id": "b00831ee-cc5d-4447-81d7-2ca1828f07b2",
23 * "name": "To-do"
24 * },
25 * {
26 * "id": "4c866e9d-4189-4570-8595-af43a1ea615e",
27 * "name": "In Progress"
28 * }
29 * ],
30 * "length": 2,
31 * "totalCount": 100,
32 * "pageSize": 2,
33 * "totalPages": 50,
34 * "currentPage": 5
35 * }
36 */