Skip to content
Salesforce Dictionary - Free Salesforce GlossarySalesforce Dictionary
DictionaryUURL (Uniform Resource Locator)
DevelopmentIntermediate

URL (Uniform Resource Locator)

A URL (Uniform Resource Locator) field is a Salesforce custom field data type that stores a web address and shows it as a clickable hyperlink on the record.

§ 01

Definition

A URL (Uniform Resource Locator) field is a Salesforce custom field data type that stores a web address and shows it as a clickable hyperlink on the record. When a user clicks the value, Salesforce opens that address in a separate browser tab or window. The field accepts up to 255 characters and saves the address as plain text underneath the link.

You pick this type when a record needs to point at an outside resource, like a company website, a video, a support portal, or a shared document. It renders as a live link on its own, so you do not need a formula or any markup to make the address clickable. That is the main reason to choose it over a plain Text field that happens to hold a web address.

§ 02

How the URL field works inside Salesforce

What a URL field stores and how it renders

A URL field holds one web address per record and shows it as a hyperlink wherever the field appears. On a record detail page, in a list view, or inside a report, the value displays as clickable text. Clicking it opens the address in a new browser tab so the user does not lose the Salesforce page they were on. Under the hood the field is a text value, capped at 255 characters, with no rich formatting. Salesforce does light formatting on display. If a user types an address without a protocol, the platform can prepend http:// so the link still resolves, which is why some reports show an http:// prefix on values that were entered without one. The field does not validate that the address actually loads or that the destination is safe. It only checks that the entry looks like a URL. Because the stored value is plain text, you can search it, filter on it in list views and reports, and reference it in formulas and Apex like any other text field. That mix of a clean link on screen and a searchable string in the data layer is what makes the type handy.

URL field versus a Text field with a link

Both a URL field and a Text field can hold the characters of a web address, so people often ask why the dedicated type exists. The difference is rendering. A Text field shows the address as flat, non-clickable characters. To turn that into a link you would build a separate Formula field of return type Text and wrap the value in a HYPERLINK function. That is two fields and a formula to maintain. A URL field gives you the clickable link directly, with no formula, and it keeps the editable address and the displayed link as one thing. The trade-off is the 255-character cap. Some tracking links, signed download URLs, and query-heavy addresses run longer than that. When an address can exceed 255 characters, a Long Text Area field paired with a HYPERLINK formula, or storing the link in a related record, is the usual fallback. For the common case of a website, a portal, or a document link that fits inside 255 characters, the URL field is the cleaner choice and the one most admins reach for.

Where URL fields show up across the platform

Once you create a URL field and add it to a page layout, the link appears on the record in both Lightning Experience and the Salesforce mobile app. In reports, the value comes through as text you can group and filter on, though the clickable behavior depends on the report environment. List views show the link too, so a rep can click straight from a list of accounts to each company website. The field is exposed through the API, so integrations and middleware can read and write it like any string. In SOQL it behaves as a text column. Lightning Web Components and Visualforce can bind to it and present it however the page needs, and Apex can read or set the value in triggers, classes, and tests. Flows can reference a URL field in conditions, assignments, and screen components. Because the underlying value is just text, you also get the standard field controls around it: field-level security to hide it from some profiles, field history tracking to record changes over time, and page layout placement to decide where it sits. The field travels through nearly every part of the platform that handles record data.

Limits and validation you should plan around

The headline limit is 255 characters. Salesforce checks that what you enter looks like a web address, but it does not confirm the page exists, that the link is live, or that the domain is trustworthy. A typo or a dead link saves without complaint. If governance matters, add a validation rule to enforce a pattern, for example requiring the value to begin with https:// so users cannot store insecure http links. You can also use validation to block known-bad domains or to require the field on certain record types. Keep in mind that the field stores a single address. If a record needs several links, you either add multiple URL fields or move to a child object with one link per row. Reporting picks up the raw text, so values entered without a protocol may surface with an http:// prefix that you did not type. Deduplication and matching rules treat the field as text, so two addresses that point at the same page but differ by a trailing slash or a query string count as different values. Planning for these edges keeps your link data clean and predictable as the object grows.

Security and trust considerations for stored links

A URL field is a doorway out of Salesforce, so treat the links it holds with some care. Anyone with read access to the field and the record can click through to whatever address is stored, and Salesforce does not scan that destination. If users can edit the field, a bad actor or a careless paste could plant a misleading link, which is a small but real phishing surface on internal records. Lock the field down with field-level security so only the profiles that need it can see or change it. Where the values should follow a rule, a validation rule that forces https:// raises the floor on link safety. For links that point back into Salesforce, prefer relative or org-specific paths so they keep working across sandboxes and production rather than hardcoding a full instance URL that breaks after a refresh. If the field feeds an automation, such as a Flow that emails the link or an integration that calls it, sanitize and validate the value first instead of trusting whatever a user typed. None of this is heavy lifting, but the field quietly sends people and processes to outside addresses, so a little discipline around who can write it and what shape it must take pays off.

A worked example: linking accounts to a partner portal

Say your team manages reseller accounts and each partner has its own portal page. You want one click from the Account record to that portal. A URL field is the fit. From the Account object you create a custom field of type URL, name it Partner Portal, and add it to the relevant page layouts so the right teams see it. Reps then paste each partner portal address into the field, and it renders as a clickable link on the account. To keep the data clean you add a validation rule that requires the value to start with https:// , so nobody stores an insecure link by accident. You set field-level security so only the partner-management profiles can edit it, while wider teams can read it. Later you build a report grouped by partner tier that lists each account with its portal link as a quick reference, and a Flow that includes the link in a welcome email to new partner contacts. The same shape works for a website link on Leads, a documentation link on Cases, or a video link on a custom training object. One field, no formula, and a live link wherever the record shows up.

§ 03

How to create a URL field

Create a custom URL field on any standard or custom object so a record can link to an external web address. You need permission to customize the object, usually the Customize Application permission.

  1. Open the object in Object Manager

    In Setup, go to Object Manager, pick the object (for example Account), then open Fields and Relationships and click New.

  2. Choose the URL data type

    On the data type step, select URL, then click Next. This is what makes the value render as a clickable link instead of plain text.

  3. Name and describe the field

    Enter a Field Label, let the API name fill in, and add help text so users know what address belongs here. Click Next.

  4. Set visibility and add to layouts

    Choose which profiles can see or edit the field with field-level security, confirm the page layouts to add it to, then click Save.

Data Typerequired

Must be set to URL so the value displays as a hyperlink and is capped at 255 characters.

Field Labelrequired

The human-readable name shown on the page layout, for example Partner Portal or Website.

Field Name (API Name)required

The unique developer name used in formulas, Apex, SOQL, and the API; auto-suggested from the label.

Gotchas
  • The value is limited to 255 characters; longer links need a Long Text Area plus a HYPERLINK formula or a child record.
  • Salesforce does not check that the link works or that the destination is safe, so add a validation rule if you need to enforce https:// or block bad domains.
  • Addresses entered without a protocol may show an http:// prefix in reports because Salesforce prepends it on display.
§

Trust & references

Sources

Cross-checked against the following references.

Official documentation

Straight from the source - Salesforce's reference material on URL (Uniform Resource Locator).

Keep learning

Hands-on resources to go deeper on URL (Uniform Resource Locator).

Was this entry helpful?
Help us write better definitions. Quick reactions or detailed edit suggestions.

About the Author

Dipojjal Chakrabarti is a B2C Solution Architect with 29 Salesforce certifications and over 13 years in the Salesforce ecosystem. He runs salesforcedictionary.com to help admins, developers, architects, and cert/interview candidates sharpen their fundamentals. More about Dipojjal.

§

Test your knowledge

Q1. What is a URL field?

Q2. How are they displayed?

Q3. What can they link to?

§

Discussion

Loading…

Loading discussion…