Search...
onLabelUpdated( )
Developer Preview
An event that triggers when a label is updated.
Description
The onLabelUpdated()
event handler runs when a label is updated. The received LabelUpdated
object contains information about the label that was updated.
Note: Backend events don't work when previewing your site.
Syntax
function wixContacts_onLabelUpdated(event: LabelUpdated): void
onLabelUpdated Parameters
NAME
TYPE
DESCRIPTION
event
Optional
LabelUpdated
Information about the task that was updated and metadata for the event.
Returns
This function does not return anything.
Return Type:
void
Was this helpful?
An event fired when a label is updated
Copy Code
1// Place this code in the events.js file2// of your site's Backend section.3// Add the file if it doesn't exist.45export function wixContacts_onLabelUpdated(event) {6 const eventId = event.metadata.id;7 const entityId = event.entity._id;8 const displayName = event.entity.displayName;9 console.log('Label updated', event);10}1112/* Full event object:13 * {14 * "metadata": {15 * "id": "a830a129-81af-47ed-b604-4e0f13ccb4cb",16 * "entityId": "custom.customer-group-3",17 * "eventTime": "2024-01-11T12:41:47.979883060Z",18 * "triggeredByAnonymizeRequest": false19 * },20 * "entity": {21 * "namespace": "custom",22 * "namespaceDisplayName": "Labels",23 * "key": "custom.customer-group-3",24 * "displayName": "Customer Group No. 3",25 * "labelType": "USER_DEFINED",26 * "legacyId": "222e7d37-9795-45e2-a6ef-58a40981a43c",27 * "_createdDate": "2024-01-11T12:36:10.000Z",28 * "_updatedDate": "2024-01-11T12:41:48.000Z"29 * }30 * }31 */