· Pauline · How-to · 8 min read
Power Fx in Customer Insights Emails: A Practical Guide
Power Fx has landed in email personalization for Dynamics 365 Customer Insights - Journeys. Here's what the supported functions do, a set of copy-paste formulas for common marketing scenarios, and why I still don't think marketing users should be the ones writing them.
Please be aware: The content is accurate at the time of creation. It may be that Microsoft has made changes in the meantime.
Microsoft has recently added Power Fx, the low-code formula language that already powers Canvas Apps, Power Apps formula fields, and Copilot Studio, to email personalization in Dynamics 365 Customer Insights - Journeys. Instead of picking a merge field from a dropdown, you can now apply a formula directly to a piece of personalized text in your email: fallback values, text formatting, string manipulation, all Excel-style.
I’ll get straight to it: I think Power Fx is a genuinely well-designed, approachable language for citizen developers. That’s not the opinion I’ll be defending here, though. What I don’t agree with is the idea that marketing users should be the ones writing these formulas by hand inside a live email. Let’s go through what’s actually available and how to use it, because there’s real value here once you frame it correctly.
What Power Fx actually is
Power Fx is described by Microsoft as a “low-code language … used across Microsoft Power Platform,” built to work like Excel formulas: declarative, always live, no compile step. The design goal is a single language that scales “from no-code for those who have never programmed before to pro-code for the seasoned professional, with no learning or rewriting cliffs in between.”
That’s the pitch, and it mostly holds up. If you’ve ever written a VLOOKUP or nested an IF in Excel, the syntax will feel familiar. That’s exactly why it’s turning up in various places across the Power Platform including, now, email personalization in Customer Insights.
How it actually works in the email editor
This isn’t a free-text scripting box dropped into the email builder. It’s attached to one personalization field at a time, and that shapes everything about how you use it:
- In the email editor, select the piece of dynamic text (personalization field) you want to transform.
- Open Personalization, then expand the Advanced section.
- Check Power Fx formula. To see this you currently first have to enable it in the features switches.
- Write your formula using the field’s display name as the variable. Wrap it in single quotes if the name contains spaces, e.g.
Upper('Event Name'). - Check the Output box, which updates live as you type, to confirm the result looks right.
- Select Save.
A few practical constraints worth knowing before you start building:
- One field per formula. A formula can only work with the single personalization field it’s attached to, plus literal text you add yourself. You can’t join two different merge fields, say,
FirstNameandCompanyName, inside one formula; that has to happen upstream, before the data reaches the email. - 500 characters, 5 levels of nesting. The formula box has a hard character limit and caps how deeply you can nest functions.
- It runs at send time, not earlier in the journey, so it always reflects the latest contact data.
- Failures fail quiet. If a formula errors, Customer Insights doesn’t block the send. It just falls back to the field’s original or default value instead. Good for deliverability, but worth remembering when you’re thinking about what “safe” actually means here (more on that at the end).
The functions available for email personalization
The formula editor’s Supported functions panel adapts to the data type of the field you selected. For a text field (the case that covers almost every marketing personalization token like names, company names, promo codes), here’s the relevant set, grouped the way you’ll actually use it.
Joining text
&for concatenation, e.g.FirstName & " — Register Today"Concatenate(t1, t2, ...)joins multiple values, e.g.Concatenate("Hi ", FirstName, "!")
Changing case
Upper(text): ALL CAPSLower(text): all lowercaseProper(text): Capitalizes Each Word
Cleaning and measuring text
Trim(text): strips leading/trailing/extra spacesLen(text): character count
Extracting parts of text
Left(text, count)/Right(text, count): first or last N charactersMid(text, start, count): characters from a given position
Editing text
Substitute(text, find, replace): swaps every occurrence of a substringReplace(text, start, count, new): swaps characters at a specific position
Handling missing data
Coalesce(value1, value2, ...): returns the first non-blank value, i.e. your fallback logic
That’s twelve building blocks for text, small enough to keep in your head, which is part of why this feels approachable rather than intimidating. Pick a number or date/time field instead, and the same panel surfaces a different set, including Text(value, format, locale) for locale-aware formatting, worth knowing if you’re sending to more than one market. I’ve included an example further down.
Formulas you can copy and paste
These are written for common real-world marketing scenarios. Swap the field names (FirstName, MemberNumber, EventName, PromoCode, RenewalDate) for whatever your actual personalization tokens are called in your environment, and remember each formula below is written for a single field, for the reasons explained above.
1. Greeting with a safe fallback (no more “Hi ,”) with a space at the wrong place
"Hi " & Coalesce(FirstName, "there") & ","Maya → Hi Maya, / (blank) → Hi there,
2. Consistent name casing from messy CRM data
Proper(Trim(FirstName))Useful when leads come from web forms, imports, or partners and arrive as " JOHN ", "john", or "John Doe". This normalizes casing and strips stray whitespace before it ever reaches a customer’s inbox.
3. A quick trick: checking a field’s rendered length before you commit
Len(Coalesce(FirstName, "Friend") & " — Don't Miss This Offer")This one isn’t meant to stay live. Paste it into the formula box and read the number in the Output preview to see how long the personalized text actually renders once a real first name (or your fallback) is substituted in. Mobile clients typically start truncating subject lines somewhere around 40–60 characters, so this catches the case where “Alexandra” pushes you past the limit even though your placeholder text fit fine. Once you’ve checked it, swap in the real formula (like #2 above) before saving.
4. Masking a loyalty or account number for personalization
"Card ending in " & Right(MemberNumber, 4)1234567890 → Card ending in 7890
A common pattern for loyalty and renewal emails: you want the message to feel personal (“your card, your account”) without ever exposing the full number in an email body. Because formula failures fall back to the original value here, it’s worth testing this one carefully. See the note at the end about what that fallback actually means for a masking formula.
5. Cleaning up promo codes for display
Upper(Substitute(PromoCode, "_", " "))summer_sale25 → SUMMER SALE25
Handy when promo codes are stored in a system-friendly format (underscores, no spaces) but you want them to read cleanly in customer-facing copy.
6. Combining several functions on one field
Concatenate("Hi ", Proper(Coalesce(Trim(FirstName), "there")), "!")This nests fallback, cleanup, and casing into a single greeting line, all built from one personalization field. It’s the kind of formula that shows why Power Fx can replace two or three separate conditional merge fields with one line.
7. Locale-correct currency and renewal date
Text(OrderTotal, "#,##0.00", "de-DE")129 → 129,00
Text(RenewalDate, "dddd, mmmm d", "de-DE")a Sunday in December → Sonntag, Dezember 31
If you send to more than one market, this is the more realistic use case for the number/date functions mentioned above: the same underlying value, formatted with the right decimal separator and the right written weekday and month for the recipient’s locale, without maintaining separate templates per country.
8. Formatting numbers for consistent display
"You're founding member No. " & Text(MemberNumber, "000")7 → You’re founding member No. 007
Zero-padding a short reference number so it always displays with the same number of digits. It’s a small touch that works well for founding-member badges, raffle or contest entries, and similar exclusivity or gamification hooks.
Summary
None of this is hard. Power Fx earns its “low-code” label, and if you’ve ever built an Excel formula, this list needs no new mental model. As a tool for citizen developers (IT, marketing ops, CRM admins), it’s a solid addition.
What I don’t buy is handing it to general marketing users to write live in a campaign email. Failures fail quiet here: a formula error doesn’t block the send, it just falls back to the original value, so a broken masking formula shows the full account number, silently, with nothing flagging it until a customer notices. My take: someone with a citizen-developer mindset builds and tests a small formula library, like the ones above; marketing users copy, paste, or use content blocks. Same benefit, without every campaign manager becoming a part-time formula author.
On my wishlist, a few functions that would make this genuinely more useful:
If/Switchfor conditional salutations or content. There’s already a separate Conditional text feature for this, which is arguably the better fit for marketing users anyway, but I’d still want it inside Power Fx too, rather than bouncing back and forth between two different personalization tools to build one email.- Combining two data points in one formula. Right now, one formula gets exactly one field, full stop.
- Basic date math (
DateDiff) for things like “3 days left in your trial” or “it’s been 90 days since your last order.” - Unlike the others when you try them,
Now()doesn’t currently return an error and it seems that it workd. But when sending an email it does not show the current date but the date of the dynamic field you have chosen.
References: Transform dynamic text with Power Fx formulas – Dynamics 365 Customer Insights | Microsoft Learn, Power Fx overview – Microsoft Learn
Do you have questions, ideas or remarks? Feel free to get in touch.