Search.../

restoreCard( )

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

Restores an archived workflow card.

The restoreCard() function returns a Promise that resolves when the archived card has been restored.

This function requires you to specify the ID of a card. To learn about retrieving IDs in the Workflow API, see Retrieving IDs.

Note: Each workflow is limited to 5,000 cards. If this limit is reached, createCard() throws an error. Archive cards when they're no longer needed to reduce card count and avoid hitting the limit.

Syntax

function restoreCard(cardId: string, options: MoveCardOptions): Promise<void>

restoreCard Parameters

NAME
TYPE
DESCRIPTION
cardId
string

ID of the card to restore.

options
MoveCardOptions

Information about where to restore the card to.

Returns

Fulfilled - When the card has been restored.

Return Type:

Promise<void>

Was this helpful?

Restore a card

Copy Code
1import { Permissions, webMethod } from 'wix-web-module';
2import { workflows } from 'wix-crm-backend';
3
4export const restoreCard = webMethod(Permissions.Anyone, async (cardId, phaseId) => {
5 return await workflows.restoreCard(
6 cardId,
7 {
8 "newPhaseId": phaseId,
9 "newPosition": 0
10 }
11 );
12});
13
14// Returns a promise that resolves to void.