👥 Linking multiple records to a single form

Sometimes a single buyer/owner field isn’t enough: notarial deeds require multiple buyers, communities of heirs have multiple owners, and the notary’s office adds an administrative entity to the mix. propform offers a solution using two forms plus recursive address loop macros.


Contents

---

Concept: Overview + Editing

You build two forms that work together:

Form Purpose
Overview form Displays currently linked buyers/owners/notaries for a property, with ‘Edit’ and ‘Link more’ buttons
Edit Form One form per person type with address fields; saves the address and automatically links it to the property

Workflow for the user:

  1. Overview form opens (using ?estate[Id]=...)
  2. Current links are listed via the loop macros
  3. Click on ‘Link (additional) buyer’ → opens the edit form without an address ID → new address is created and linked
  4. Click on “Edit address” → opens the edit form with the address ID → existing address is edited
  5. The edit form uses the overview form as the thank-you page → user is automatically redirected back to the updated overview

---

Step 1: Build the edit form

This is the simpler of the two forms. It contains:

  • Address fields (title, first name, surname, street, postcode, town, telephone, email …)
  • Form settings: “Link property and address” as buyer, owner or via a contact type (e.g. solicitor, property management)
  • Thank you page = URL of the overview form (e.g. https://formular.deine-domain.de/notarbeauftragung-uebersicht?estate[Id]=_Uuidestate)

> 💡 Tip: You need a separate editing form for each person type (i.e. one each for buyer, owner, solicitor, property management), as each has a different linking logic.

> 💡 Simplification: If the edit forms all have the same layout, you can create them using the “Copy form” function and simply adjust the link settings.

---

Step 2: Build the overview form

The overview form consists of a single description field containing the loop macros. The fields are populated entirely via macros from onOffice.

Key components per loop:

  1. _ifEmpty(_Name;"Kein X verbunden";"...") — if no record is linked yet, display a meaningful message
  2. Start of loop _buyerbrek_1_ (Buyer-Begin-Recursion) or _ownerbrek_1_ (Owner-Begin-Recursion)
  3. Loop content — pre-macros such as _BuyerVorname, _BuyerName, _BuyerStrasse, plus an ‘Edit address’ link with the UUID
  4. End of loop _buyererek_1_ or _ownererek_1_
  5. “Connect more” link outside the loop (opens the edit form without an address ID)

---

Code example: Owner loop

_ifEmpty(_EigentName;"Kein Eigentümer verbunden";"_ownerbrek_1_
_OwnerTitel _OwnerVorname _OwnerName _ifEmpty(_OwnerName2;"";", _OwnerTitel2 _OwnerVorname2 _OwnerName2")
_OwnerStrasse
_OwnerPLZ _OwnerOrt
_OwnerTelefon, _OwnerEmail
<a href='https://formular.deine-domain.de/eigentuemer-bearbeiten?address[ID]=_OwnerUuidaddress&estate[Id]=_Uuidestate'>Adresse bearbeiten</a>

_ownererek_1_")
<a href="https://formular.deine-domain.de/eigentuemer-bearbeiten?estate[Id]=_Uuidestate">(Weiteren) Eigentümer verbinden</a>

What happens:

  • _EigentName (standard onOffice macro) checks whether an owner is linked at all
  • _ownerbrek_1_ ... _ownererek_1_ iterates through all linked owners
  • For each owner, title/first name/surname/address/contact details are displayed + an “Edit address” link with _OwnerUuidaddress (UUID of the current owner in the loop)
  • Outside the loop, there is a ‘Link (additional) owner’ link without an address ID → creates a new address

---

Code example: Buyer loop

Exactly the same pattern as for owners, but with buyer instead of owner and _Buyer* pre-macros instead of _Owner*:

_ifEmpty(_KaeuferName;"Kein Käufer verbunden";"_buyerbrek_1_
_BuyerTitel _BuyerVorname _BuyerName _ifEmpty(_BuyerName2;"";", _BuyerTitel2 _BuyerVorname2 _BuyerName2")
_BuyerStrasse
_BuyerPLZ _BuyerOrt
_BuyerTelefon, _BuyerEmail
<a href='https://formular.deine-domain.de/kaeufer-bearbeiten?address[ID]=_BuyerUuidaddress&estate[Id]=_Uuidestate'>Adresse bearbeiten</a>

_buyererek_1_")
<a href="https://formular.deine-domain.de/kaeufer-bearbeiten?estate[Id]=_Uuidestate">(Weiteren) Käufer verbinden</a>

---

Code example: Specific contact type (solicitor, administration, etc.)

If you do not want to cycle through all linked addresses of a contact type, but instead want to output a specific contact type directly (e.g. “the solicitor for this property”), use the _XAPKontaktart#NAME# macro:

_ifEmpty(_XAPKontaktart#Notar#Name;"Kein Notariat verbunden
<a href='https://formular.deine-domain.de/notar-verbinden?estate[Id]=_Uuidestate'>Jetzt Notar verbinden</a>";"
_XAPKontaktart#Notar#Firma1
_XAPKontaktart#Notar#Vorname _XAPKontaktart#Notar#Name
_XAPKontaktart#Notar#Strasse, _XAPKontaktart#Notar#PLZ _XAPKontaktart#Notar#Ort
_XAPKontaktart#Notar#Telefon
_XAPKontaktart#Notar#Email
<a href='https://formular.deine-domain.de/notar-bearbeiten?address[ID]=_XAPKontaktart#Notar#Uuidaddress&estate[Id]=_Uuidestate'>Adresse bearbeiten</a>")

Notar is the name of the contact type option in onOffice. For your own contact type values, you must use the exact key value, e.g.:

_XAPKontaktart#indMulti28075Select28075#Name

> 💡 You can find the key value in onOffice under Tools → Settings → Administration → Addresses → “Contact Type” field → for the respective option.


Complete example of a notary assignment

A typical notary assignment overview form combines all loops + contact types in a single description field:

**Eigentümer**

_ifEmpty(_EigentName;"Kein Eigentümer verbunden";"_ownerbrek_1_
_OwnerTitel _OwnerVorname _OwnerName _ifEmpty(_OwnerName2;"";", _OwnerTitel2 _OwnerVorname2 _OwnerName2")
_OwnerStrasse
_OwnerPLZ _OwnerOrt
_OwnerTelefon, _OwnerEmail
<a href='https://formular.deine-domain.de/notarbeauftragung-adresse-bearbeiten?address[ID]=_OwnerUuidaddress&estate[Id]=_Uuidestate'>Adresse bearbeiten</a>

_ownererek_1_")
<a href="https://formular.deine-domain.de/notarbeauftragung-eigentuemer-verbinden?estate[Id]=_Uuidestate">(Weiteren) Eigentümer verbinden</a>

---

**Käufer**

_ifEmpty(_KaeuferName;"Kein Käufer verbunden";"_buyerbrek_1_
_BuyerTitel _BuyerVorname _BuyerName _ifEmpty(_BuyerName2;"";", _BuyerTitel2 _BuyerVorname2 _BuyerName2")
_BuyerStrasse
_BuyerPLZ _BuyerOrt
_BuyerTelefon, _BuyerEmail
<a href='https://formular.deine-domain.de/notarbeauftragung-adresse-bearbeiten?address[ID]=_BuyerUuidaddress&estate[Id]=_Uuidestate'>Adresse bearbeiten</a>

_buyererek_1_")
<a href="https://formular.deine-domain.de/notarbeauftragung-kaeufer-verbinden?estate[Id]=_Uuidestate">(Weiteren) Käufer verbinden</a>

---

**Notariat**

_ifEmpty(_XAPKontaktart#Notar#Name;"Kein Notariat verbunden
<a href='https://formular.deine-domain.de/notarbeauftragung-notar-verbinden?estate[Id]=_Uuidestate'>Jetzt Notar verbinden</a>";"
_XAPKontaktart#Notar#Firma1
_XAPKontaktart#Notar#Vorname _XAPKontaktart#Notar#Name
_XAPKontaktart#Notar#Strasse, _XAPKontaktart#Notar#PLZ _XAPKontaktart#Notar#Ort
_XAPKontaktart#Notar#Telefon
_XAPKontaktart#Notar#Email
<a href='https://formular.deine-domain.de/notarbeauftragung-adresse-bearbeiten?address[ID]=_XAPKontaktart#Notar#Uuidaddress&estate[Id]=_Uuidestate'>Adresse bearbeiten</a>")

→ After opening the form, the user sees a clear overview of all linked individuals, along with buttons to edit or add further individuals.


Common pitfalls

Company as owner/buyer is recognised as “empty”

_ifEmpty(_EigentName;...) only checks the surname. In company records, _EigentName is often empty and only _EigentZusatz1 (company name) is populated. Solution: Add “Additional1” to the check, e.g.:

_ifEmpty(_EigentName;_ifEmpty(_EigentZusatz1;"Kein Eigentümer verbunden";"...");"...")

Master data 2 not activated

The fields _OwnerName2, _OwnerStrasse2, _OwnerPLZ2 etc. (second address within a record) are not enabled by default in many versions of onOffice. If your loop accesses these and nothing is displayed, check in onOffice under Tools → Settings → Administration → Addresses to see if the Master Data 2 fields are enabled.

Link is not resolved

HTML links in the description field work, but the quotation marks must be either single ' OR double " — do not mix them within the same element. The nested _ifEmpty(...; ""; "...") often forces you to write the HTML attributes using '.

Multiple loops simultaneously

You can easily combine the _buyerbrek_1_/_buyererek_1_ and _ownerbrek_1_/_ownererek_1_ loops in the same description field. _1_ is an internal counter — if you need multiple buyer loops in a single field (rare), increase the number: _buyerbrek_2_, _buyererek_2_.

Edit form creates address twice

If the address is duplicated instead of updated on the second submission: The address[ID] parameter has not been received or the form is not configured to “pre-fill address”. Check the pre-fill settings.


Related