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
| Property | Description |
|---|---|
labelstring | Visible label. |
descriptionstring | Helper text. |
requiredboolean default: false | Marks the field required. |
readOnlyboolean default: false | Disables editing. |
Type-specific properties
| Property | Description |
|---|---|
hyperlinkUrlstring | Default URL component prefilled on a new form. |
hyperlinkDescriptionstring | 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
Related articles
- URL field
A text input for web addresses, clickable when read-only, validated for valid URL syntax on submit.