@asralsuvilgaa
If you read the API info, it looks like it does it all in the events.js backend file, so in theory you just need to get the data returned from that function.
If you have used the code in your backend events.js file…
onCardMoved( )
An event that fires when a workflow card is moved.
Description
The onCardMoved() event handler runs when a workflow card is moved programmatically using the moveCard() function or manually in your site’s Dashboard. The received CardMovedEvent object contains information about the card that was moved.
Examples
An event when a card is moved
// Place this code in the events.js file
// of your site's Backend section.
export function wixCrm_onCardMoved(event) {
let workflowId = event.workflowId;
let cardName = event.card.name;
}
/* Full event object:
* {
* "workflowId": "f2cb00b5-9286-4d35-b41b-367d6fec43ce",
* "workflowName": "n89f2df2-2919-43jk-3uio-v90se98s5ipf",
* "newPhaseId": "In Progress",
* "newPhaseName": "sd98iop3-87v3-ni4u-9438-vjc9hu8ec80w",
* "previousPhaseId": "b00831ee-cc5d-4447-81d7-2ca1828f07b2",
* "previousPhaseName": "To-do",
* "card": {
* "name": "This is a card.",
* "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
* }
* }
*/
As it states that it should either trigger the onCardMoved() event handler when you either move the card manually through your dashboard or if you have added any code that moves the card for you.
Move a card
import wixCrm from 'wix-crm-backend';
export async function moveCard(cardId, phaseId){
return await wixCrm.workflows.moveCard(
cardId,
{
"newPhaseId": phaseId,
"newPosition": 0
}
);
}
// Returns a promise that resolves to void.
Have you just tried doing the basic code examples as they are given and adding a basic way of receiving the backend module data, have a look here for a quick example.
I haven’t used it myself personally, so it is only try/test it for now and see what happens, hopefully Shan or a Wix Mod comes back with a much better reply in the other forum post about it.
Also, make sure that the testing is all done on a fully published website and not just through the preview mode otherwise your backend events will not work.