deleteExtendedField( )


Deletes an extended field.

The deleteExtendedField() function returns a Promise that resolves when the specified extended field is deleted.

When an extended field is deleted, any contact data stored in the field is permanently deleted as well.

Note: Only visitors with Manage Contacts permissions can delete extended fields. You can override the permissions by setting the suppressAuth option to true.

Method Declaration
Copy
function deleteExtendedField(key: string, options: AuthOptions): Promise<void>;
Method Parameters
keystringRequired

Extended field ID.


optionsAuthOptions

Authorization options.

Delete an extended field
JavaScript
import { Permissions, webMethod } from "wix-web-module"; import { contacts } from "wix-crm-backend"; export const myDeleteExtendedFieldFunction = webMethod( Permissions.Anyone, () => { const fieldKey = "custom.event-name"; const options = { suppressAuth: false, }; return contacts .deleteExtendedField(fieldKey, options) .then(() => { console.log("Extended field deleted"); }) .catch((error) => { console.error(error); }); }, );
Did this help?

deleteLabel( )


Deletes a label from the site and removes it from contacts it applies to.

The deleteLabel() function returns a Promise that resolves when the specified label is deleted.

Note: Only visitors with Manage Contacts permissions can delete labels. You can override the permissions by setting the suppressAuth option to true.

Method Declaration
Copy
Method Parameters
keystringRequired

Label key to delete.


optionsAuthOptions

Authorization options.

Delete a label
JavaScript
Did this help?

findOrCreateExtendedField( )


Retrieves a custom field with a given name, or creates one if it doesn't exist.

The findOrCreateExtendedField() function returns a Promise that resolves when the specified custom field is found or created.

Successful calls to findOrCreateExtendedField() always return an extended field, which can be passed to subsequent function calls.

To find an existing extended field without potentially creating a new one, use getExtendedField() or queryExtendedFields().

Note: Only visitors with Manage Contacts permissions can find or create extended fields. You can override the permissions by setting the suppressAuth option to true.

Method Declaration
Copy
Method Parameters
extendedFieldInfoExtendedFieldInfoRequired

Custom field to find or create.


optionsAuthOptions

Authorization options.

Returns
Return Type:Promise<FoundOrCreatedExtendedField>
JavaScript
Did this help?

findOrCreateLabel( )


Retrieves a label with a given name, or creates one if it doesn't exist.

The findOrCreateLabel() function returns a Promise that resolves when the specified label is found or created.

Successful calls to findOrCreateLabel() always return a label, which can be passed to subsequent function calls.

To find an existing label without potentially creating a new one, use getLabel() or queryLabels().

Note: Only visitors with Manage Contacts permissions can find or create labels. You can override the permissions by setting the suppressAuth option to true.

Method Declaration
Copy
Method Parameters
displayNamestringRequired

Label display name to retrieve or create.

If an existing label is an exact match for the specified display name, the existing label is returned. If not, a new label is created and returned.


optionsAuthOptions

Authorization options.

Returns
Return Type:Promise<FoundOrCreatedLabel>
JavaScript
Did this help?