Hyperlink field

A SharePoint Hyperlink-or-Picture column, URL + display label stored together.

The Hyperlink field binds to SharePoint's Hyperlink or Picture column, which stores both a URL and a separate display label. Different from

URL, which uses a plain Text column and stores only the address.

Common properties

PropertyDescription
label
string
Visible label.
description
string
Helper text.
required
boolean
default: false
Marks the field required.
readOnly
boolean
default: false
Disables editing.

Type-specific properties

PropertyDescription
hyperlinkUrl
string
Default URL component prefilled on a new form.
hyperlinkDescription
string
Default display text. When empty, the URL itself is shown as the link text.

JavaScript recipes

The value is a dual object, { url, description }.

Read the URL and label

const link = f365.field('Homepage').value as { url: string; description: string } | null;
const href = link?.url ?? '';
const text = link?.description || href;

Set both parts programmatically

f365.field('Homepage').value = {
  url: 'https://contoso.com',
  description: 'Contoso',
};

Default the label to the URL on change

f365.events.onChange((e) => {
  if (e.fieldKey !== 'Homepage') return;
  const v = e.newValue as { url: string; description: string } | null;
  if (v?.url && !v.description) {
    f365.field('Homepage').value = { url: v.url, description: v.url };
  }
});

Require https before saving

f365.events.onValidate((errs) => {
  const link = f365.field('Homepage').value as { url: string } | null;
  if (link?.url && !link.url.startsWith('https://')) {
    errs.add('Homepage', 'Link must use https://');
  }
});

Related articles

  • URL field

    A text input for web addresses, clickable when read-only, validated for valid URL syntax on submit.