Search.../

getExtendedField( )

Developer Preview

Retrieves an extended field.

Description

The getExtendedField() function returns a Promise that resolves when the extended field is retrieved.

Note: Only visitors with Manage Contacts permissions can retrieve extended fields.

This function is not a universal function and runs only on the backend.

Admin Method

This function requires elevated permissions to run. This function is not universal and runs only on the backend.

Syntax

function getExtendedField(key: string): Promise<ExtendedField>

getExtendedField Parameters

NAME
TYPE
DESCRIPTION
key
string

Extended field key.

When accessing contact data, extended field values are available at fields[key]. For example, if the key is "custom.notes", the value can be accessed at fields["custom.notes"].

Once set, key cannot be modified, even if displayName changes.

Returns

The specified field.

Return Type:

Promise<
ExtendedField
>
NAME
TYPE
DESCRIPTION
_createdDate
Date

Date and time the field was created.

_updatedDate
Date

Date and time the field was last updated.

dataType
string

Type of data the field holds.

One of:

  • "TEXT": Accepts strings.
  • "NUMBER": Accepts floats.
  • "DATE": Accepts dates formatted as YYYY-MM-DD.
  • "URL": Accepts strings. Prepends https:// if no protocol is included.
description
string

Field description, if the field is a system field.

displayName
string

Display name shown in the Contact List.

fieldType
string

Indicates whether the extended field is a system field or custom field.

One of:

  • "SYSTEM": The field is a system field managed by Wix. System fields cannot be modified by 3rd-party apps or site contributors.
  • "USER_DEFINED": The field is a custom field and can be modified by 3rd-party apps or site contributors.
key
string

Extended field key.

When accessing contact data, extended field data is available at fields[key]. For example, if the key is "custom.notes", the value can be accessed at fields["custom.notes"].

key is generated when the extended field is created and cannot be modified, even if displayName changes.

namespace
string

Extended field namespace.

Extended fields created by site contributors or 3rd-party apps are automatically assigned to the custom namespace.

Was this helpful?

Get an extended field

Copy Code
1import { extendedFields } from 'wix-crm.v2';
2
3export function myGetExtendedFieldFunction() {
4 const key = 'custom.event-name';
5
6 return extendedFields.getExtendedField(key)
7 .then((extendedField) => {
8 return extendedField;
9 })
10 .catch((error) => {
11 console.error(error);
12 });
13}
14
15/*
16 * Promise resolves to:
17 *
18 * {
19 * "_createdDate": "2021-01-19T21:41:39Z",
20 * "_updatedDate": "2021-01-19T21:41:39Z"
21 * "namespace": "custom",
22 * "key": "custom.event-name",
23 * "displayName": "Event Name",
24 * "dataType": "TEXT",
25 * "fieldType": "USER_DEFINED",
26 * }
27 */