Flows · Formulas

You want Farmers Co-op – Service Opportunity – 08/25/2026. Salesforce has other ideas about what a date looks like inside a text field. Five copy-paste Flow formulas to get exactly the format you want.

5 formatsM/D/YYYY, MM/DD/YYYY, DD/MM/YYYY, ISO, Month YYYY
4 functionsMONTH, DAY, YEAR, TEXT. Plus LPAD for zeros
Copy, paste, swapyour Date resource into the formula
3‑minute videoThe fix, start to finish
On this page
  1. The problem
  2. 1 · Find the date
  3. 2 · Five formats
  4. 3 · Swap in and activate
  5. Where else
  6. Gotchas and FAQ
Watch on YouTube ↗
The problem

A date walks into a text field.

Drop a Date resource straight into a text formula and you don’t get the tidy date you pictured. Convert it to text first, on your terms.

The example from the video: a New Service Opportunity Flow, launched from a button, that names the Opportunity Account Name – Service Opportunity – Close Date. The goal is Farmers Co-op - Service Opportunity - 08/25/2026. Insert the Close Date resource directly, and the date in the name comes out in a format nobody asked for.

Salesforce Opportunity whose Flow-generated name shows the Close Date in an unformatted way
The “before”: the name works, the date doesn’t.

The fix: pull the month, day and year out of the date, turn each into text, and glue them together with whatever separators you want.

Prefer to read? Everything in the video is written out below.

Step 1

Find where the date goes into the text.

Open the Flow and find the element that builds the name.

In the example it’s the Update Opportunity element, whose Opportunity Name formula is roughly:

{!Account.Name} + " - Service Opportunity - " + {!CloseDate}

That last piece, the raw Date resource, is the part to replace.

Step 2

Pick a format. Here are five.

Each one replaces the raw date. Swap {!CloseDate} for your own Date resource.

The building blocks are the same in all of them: MONTH(), DAY() and YEAR() pull the numbers out, TEXT() turns each number into text, and + joins the pieces.

WAY 1 · M/D/YYYY

The formula from the video. No leading zeros.

TEXT(MONTH({!CloseDate})) + "/" + TEXT(DAY({!CloseDate})) + "/" + TEXT(YEAR({!CloseDate}))

Result: 8/25/2026

WAY 2 · MM/DD/YYYY

Same idea, padded so every date is the same length. Sorts and scans better.

LPAD(TEXT(MONTH({!CloseDate})), 2, "0") + "/" + LPAD(TEXT(DAY({!CloseDate})), 2, "0") + "/" + TEXT(YEAR({!CloseDate}))

Result: 08/25/2026

WAY 3 · DD/MM/YYYY

Day first, for UK and most of Europe.

LPAD(TEXT(DAY({!CloseDate})), 2, "0") + "/" + LPAD(TEXT(MONTH({!CloseDate})), 2, "0") + "/" + TEXT(YEAR({!CloseDate}))

Result: 25/08/2026

WAY 4 · YYYY-MM-DD

TEXT() on a date already returns ISO format. Shortest formula, and it sorts alphabetically in date order.

TEXT({!CloseDate})

Result: 2026-08-25

WAY 5 · Month YYYY

For names that only care about the month.

CASE(MONTH({!CloseDate}), 1,"January", 2,"February", 3,"March", 4,"April", 5,"May", 6,"June", 7,"July", 8,"August", 9,"September", 10,"October", 11,"November", "December") + " " + TEXT(YEAR({!CloseDate}))

Result: August 2026

Step 3

Swap it in, save and activate.

Replace the raw date in the name formula with your chosen expression, then activate the new version.

{!Account.Name} + " - Service Opportunity - " + LPAD(TEXT(MONTH({!CloseDate})), 2, "0") + "/" + LPAD(TEXT(DAY({!CloseDate})), 2, "0") + "/" + TEXT(YEAR({!CloseDate}))
  1. Save the Flow and activate the new version. Test the old version and you’ll wonder why nothing changed.
  2. From the Opportunities tab, launch the Flow, fill it in and click Next.
  3. Open the new Opportunity and check the name.
Where else

Other places this comes up.

Any time a date has to live inside a sentence.

  • Record names: Service Opportunity - 08/25/2026
  • Text summaries: Project: Website Migration | Due: 08/25/2026
  • Descriptions: Service: Plumbing | Scheduled: 08/25/2026
  • Migration and integration values that expect the date as text in a specific format. ISO (Way 4) is usually the safe bet.
Gotchas

The questions people ask.

Why can’t I just add the Date to the text?
Because Date and Text are different data types. Converting the parts yourself is how you control exactly what the text looks like.
My dates show as 8/5/2026 instead of 08/05/2026
Wrap the month and day in LPAD(…, 2, "0"), as in Way 2.
I changed the formula but the name didn’t change
You’re probably still running the old version. Activate the new one.
Does this work with Date/Time fields?
Convert to a date first with DATEVALUE({!YourDateTime}), then use any of the formulas above.
Where can I copy the formula?
From this page, or from the description of the YouTube video.
Data Migration Masterclass

Flows are half the job after a migration.

The Masterclass covers the migration itself and the automation decisions around it, from bypasses to what to switch back on after go-live.

Know someone fighting dates in Flow formulas?

Share on LinkedIn