Skip to content

Publishing contacts

Filters and transformations

Publishing part of a list, rewriting values on the way out, and the name every recipient sees.

Most publications deliver the source folder as it stands. Two things change that: a filter, which decides which contacts are published, and a transformation, which rewrites what a published contact says. Both live on a publication’s Contacts tab, and the tab keeps them behind a switch unless the publication already has some — a filter is the difference between publishing a list and publishing part of one, and it applies to every recipient at once.

The source is never written to. Everything here happens on the way out.

A filter is a rule read against every contact in the source folder: an action, a property, an operator and a value. Contacts that pass are delivered; contacts that do not are not.

Not publishing is not the same as not updating. A contact that stops passing the filters is removed from every recipient’s folder, because the folder is meant to hold what the publication currently says it holds.

OperatorMatches when
isa value on the property equals the value given
is notno value on the property equals it
containsa value on the property contains it
does not containno value on the property contains it
ends witha value on the property ends with it
has any valuethe property holds something
is emptythe property holds nothing

Comparison is case-insensitive throughout. A property holding several values — categories, the business phones, the email collection — matches if any one of them does.

The two negative operators are worth reading twice: is not and does not contain also match a contact whose property is empty. There is no value there to contradict them. has any value and is empty take no value, and the field for one is disabled.

Every enabled rule is evaluated, and the outcome is decided in one pass rather than by position:

  • A contact matching any Exclude rule is not published, whatever else it matched.
  • If the publication has at least one Include rule, a contact must match one of them to be published.
  • With no Include rules at all, everything not excluded is published.

Rule order numbers the rules and orders the explanation a screen gives; it does not decide the answer. A rule switched off is kept and ignored.

Any property of the contact, written as Microsoft Graph names it — categories, companyName, jobTitle, surname. Three more are computed rather than stored:

PropertyWhat it holds
emailDomainthe domain part of every email address on the contact
hasBusinessEmailtrue when the contact has any email address
hasTelephonetrue when the contact has a business phone, a mobile or a home phone

For the two true/false properties, has any value reads as true and is empty as false.

A transformation writes one destination property of the delivered contact from one or more source properties. Any contact field can be the destination except four. The photo is not carried as JSON and has no transform that could produce it. primaryEmailAddress, secondaryEmailAddress and tertiaryEmailAddress are Microsoft’s second view of email positions 1, 2 and 3 rather than places of their own, and a delivered contact carries the collection alone — so a rule must write emailAddresses, which takes the whole collection. The destination list offers neither.

TransformWhat it writes
Copy as-isThe first named source property that has a value.
Fixed valueThe rule’s configured value, whatever the contact holds.
First non-emptyThe first named source property that has a value.
Join fieldsThe named properties joined with the rule’s separator, a single space by default.
Normalise emailEvery address in the email collection, trimmed and lower-cased.
Normalise phoneThe number with runs of whitespace collapsed to single spaces.
Add categoryThe categories the contact already carries, plus the rule’s.
Remove categoryThe categories the contact already carries, less the rule’s.
Clear fieldNothing — the destination property is removed from the delivered contact.
Normalise casingThe value recased as title case, UPPERCASE or lowercase.
Format phone numbersEvery number the field holds, in one international format. See the number format.

Four of them are worth a sentence more.

Join fields trims each part and drops the empty ones, separator included. A contact with no surname therefore reads Hans rather than Hans, — which is the case that makes hand-built string templates produce rubbish on exactly the contacts nobody checks.

Normalise casing leaves a value that already mixes upper and lower case exactly as it is. Somebody wrote “von Grünigen” or “McDonald” that way on purpose, and only the all-caps and all-lowercase entries are plainly typing rather than intent. UPPERCASE and lowercase carry no such guard: asking for one is already the instruction that title case has to infer. Casing changes what a recipient reads and never which card is claimed — matching lower-cases before it compares.

Add category and Remove category read the value built so far rather than the source contact, and they always write a de-duplicated, sorted list.

Two general rules sit underneath the table. A transform that produces nothing leaves the destination as it was; only Clear field removes it. And a value that comes out empty is dropped rather than delivered as a blank.

Fixed value, Join fields and the two category transforms each carry a setting — the value, the separator, the category names. The builder on the Contacts tab does not offer fields for those: it carries whatever a rule already has through every save untouched, and the casing mode is the setting it can change. A rule that needs a new parameter is built through the API. The name format writes one itself.

Each rule can also carry a condition — one property, one of the operators above, one value — and is skipped on contacts the condition does not match. Conditions are set through the API; the builder does not create them.

Three steps, always in this order:

  1. Filter. Read against the source contact as it stands. An excluded contact goes no further.
  2. Map. The transformations, in rule order, producing the contact that should be delivered.
  3. Project. The field set, which drops every field it does not allow and empties every numbered position it does not allow.

Two consequences follow from the order. A filter cannot test a value a transformation produced, because the filter has already run. And a transformation writing a field the field set blocks changes nothing — the value is computed and then discarded with everything else the set blocks. The same holds one position at a time: a rule that fills Business phone 2 on a card whose audience does not get that position delivers an empty entry there, not the number.

The card already in the mailbox has been through the transformations once, on the way in, so they are never applied to it a second time; both sides of every comparison are projected with the same field set. That is what stops a rule producing a contact reported wrong on every check and repaired by a write that cannot change the answer.

Saving rules raises the publication’s version, invalidates the last dry run, and — if the publication is active — requeues the whole audience. Every delivered contact is written again, not only the ones that happen to change later. Run a fresh dry run before delivery continues.

Rules belong to one publication unless a set owns them. A rule set is named, lives on one source, and can be followed by every publication on that source, so an exclusion that applies everywhere is written once and changed once. Field sets already worked this way; this is the same answer for the other half of a publication’s behaviour.

A set is source-scoped for the same reason a field set is: its rules name properties of the folder they were written against, and following one from another source would quietly match nothing. Linking across sources is refused.

ActionWhat happens
Follow a setThe publication’s rules are replaced by the set’s — a version, a cleared dry run and a requeue, exactly as though somebody had typed them.
Edit a followed setEvery publication following it is rewritten. The save reports how many, and how much work that queued.
Save as setThe rules a publication already has are lifted into a new set, which that publication then follows.
UnlinkThe publication keeps exactly the rules it has and stops following.
Delete the setIt stops being offered, and every publication following it keeps its rules and stops following.

A source’s Publications tab lists its sets under Rule sets: who follows each, and how many filters and transformations it holds. New set makes an empty one for publications to follow afterwards, and Delete on a set’s row deletes it.

Leaving a set is never a way to lose rules, and neither is deleting one. That matters because the reasonable fear about retiring something several publications depend on is precisely that they lose what it gave them.

The screen names the followers before an edit rather than after: changing a shared set is changing every publication on it, and that is a fact worth having while deciding. A follower still on an older version of the set is marked as behind, so a rewrite that failed partway across a large estate is visible rather than silent.

While a set is followed there is no second editor. The builders on the Contacts tab are the same ones, and Save to the set is where they write.

On the Fields tab, under the field set it depends on.

Outlook stores “File as” as a string on the contact, decided by whoever typed it in. A source folder several people have added to over ten years therefore holds a mixture of “Muster, Hans” and “Hans Muster”, and every recipient inherits the mixture. It is not a rendering setting a recipient can correct on their side, which is why it is fixed here or not at all.

OptionA contact named Hans Muster at Egger AG reads
As in sourceas it was typed, inconsistency included
Surname, first nameMuster, Hans
First name surnameHans Muster
CompanyEgger AG

A checkbox applies the same format to the full name as well. Which of the two somebody sees depends on where they look: the Outlook contact list sorts and labels by “File as”, while the contact card, Outlook on the web and the phone apps show the full name. Setting one and not the other fixes the complaint on some screens only.

Three things follow from how it is built — as a Join fields rule, not as a mechanism of its own:

  • Empty parts and their separators disappear. A contact with no surname reads Hans, never , Hans.
  • It is computed before the field set is applied, so a set that blocks “File as” discards the result along with everything else it blocks. The screen says so rather than saving happily and changing nothing.
  • Changing it on a publication that has already delivered rewrites the name on every contact in every recipient’s mailbox. This is confirmed rather than prevented: it cannot do less, because a format applied only to contacts that change from now on leaves each folder holding both formats, which is the inconsistency the setting exists to end.

A name rule built by hand through the API that the editor cannot express is reported as such and left alone. Choosing an option replaces it.

On the Fields tab, under the name format.

A company’s lists hold the same line as 044 555 01 01, +41 (0)44 555 01 01 and 0041 44 555 01 01. Caller ID on a phone and in Teams matches a number best in one international form, so the publication can write every number it delivers in one.

Option044 555 01 01 is delivered as
As in source044 555 01 01, as typed
International+41 44 555 01 01, grouped as its country writes it
E.164+41445550101

It applies to every phone field a contact carries: business 1 and 2, home 1 and 2, and mobile. Fax, pager and the other Outlook numbers have no place in a contact Microsoft Graph delivers, so there is nothing of them to format. The source contact is never changed.

The region. A number with no country code is read in the tenant’s Phone region, on the tenant’s Settings tab: Switzerland unless an Admin chose another. The region is written into the publication’s rules when the format is saved. Changing it on the tenant therefore changes no delivered number by itself; each publication that formats numbers then says it reads them in another region, and offers to read them in the tenant’s, which is an edit like any other.

What is left as it is. A number is rewritten only when it reads as one valid number of a country, with no letters and no extension. An extension written out (Durchwahl 12), a short internal number (1234) and two numbers in one field are delivered exactly as the source has them, never dropped.

The preview. Choosing a format shows, before anything is saved, how many numbers would change, how many are already in the format and how many would be left as they are, with a table of the changing and the left ones, before and after.

On a delivering publication the save is an edit of its rules, so it waits for a sign-off like any other: nothing changes in a mailbox until somebody signs the new version off, and the sign-off lists the same numbers. Once signed, every card is rewritten once. The format writes only what a card read back already agrees with, so the listings and reconciliations after it find nothing to repair.

The format is stored as one Format phone numbers rule per phone field, after every other rule. It formats what the field holds when the other rules are done, so a switchboard number a Fixed value rule writes is formatted too. A format rule built by hand that the card cannot show is reported, and choosing an option replaces it.

A shared customer folder, published to dispatch. Only customers should go, and the names should read the same way for everybody.

Filters, on the Contacts tab:

#ActionPropertyOperatorValue
1IncludecategoriescontainsKunde
2ExcludecategoriescontainsIntern

A contact categorised Kunde is published. One categorised both Kunde and Intern is not — an exclude match wins whatever else matched. One with no categories at all is not either, because an Include rule exists and nothing matched it. Delete rule 1 and the reading changes completely: the whole folder is published except the internal contacts.

One transformation:

#DestinationTransformSource propertiesCasing
1SurnameNormalise casingsurnameTitle case

MUSTER is delivered as Muster. von Grünigen already mixes cases and is delivered as written.

Name format, on the Fields tab: Surname, first name. Every delivered card files as Muster, Hans, whichever way the source contact happens to be filed.

Saving any of the three invalidated the dry run. Run a new one: the delivery map will show how many contacts now pass the filters, and that number against the folder’s total is the check that rule 1 says what you meant.