Deprecated. This event will continue to work until June 30, 2024.
An event that triggers when a new workflow card is created.
The onCardCreated()
event handler runs when a new workflow
card is created programmatically using the createCard()
function or manually in your site's Dashboard. The received CardCreatedEvent
object contains information about the card that was created.
Note: Backend events don't work when previewing your site.
function onCardCreated(event: CardCreatedEvent): void;
The created card's data.
// Place this code in the events.js file
// of your site's Backend section.
export function wixCrm_onCardCreated(event) {
let workflowId = event.workflowId;
let cardName = event.card.name;
}
/* Full event object:
* {
* "workflowId": "f2cb00b5-9286-4d35-b41b-367d6fec43ce",
* "workflowName": "My Workflow",
* "phaseId": "ngp4030h-no3q-038h-c390-of40dn28pc9e",
* "phaseName": "To-do",
* "card": {
* "name": "This is a card.",
* "source": "Contacts",
* "id": "gd83brj9-34n8-ce8h-fh08-4e90cni3df89",
* "contactId": "ej8994ed-h3e9-uh2w-fhu0-vj013in3cej8",
* "createdAt": 2019-03-13T00:00:00.000Z,
* "updatedAt": 2019-06-12T00:00:00.000Z
* }
* }
*/
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.