An OpenOrchestrator robot that registers employee sign-ups for Altinget in a SharePoint list. When an employee submits the "Tilmelding til Altinget" form in OS2Forms, the robot picks up the submission, reads the employee data, and creates a corresponding row in a SharePoint list.
The robot runs as a queue-based process in openorchestrator. Each queue element references a single OS2Forms submission, and the robot processes it as follows:
- Read the queue element. The element's
datacontains anapplication_uuid— the ID of the OS2Forms submission to process. - Fetch the submission from the OS2Forms REST API
(
<api-url>/tilmelding_til_altinget/submission/<application_uuid>), authenticated with an API key. The employee fields live underdata.mine_medarbejder_data. - Authenticate to SharePoint using an app-only (client certificate) login against the team site.
- Map the form fields to the internal SharePoint column names (see table below).
- Create a new list item in Tilmeldte medarbejdere. On any failure the error is logged and re-raised, so the queue element is marked FAILED rather than silently completing.
The form fields from mine_medarbejder_data are mapped to the internal SharePoint column
names (not the display names):
| OS2Forms field | SharePoint column (internal name) | Example value |
|---|---|---|
name |
Title |
Employee name |
az |
Az_x002d_ident |
AZ identifier |
organisation_enhed |
Afdeling |
Digital Udvikling |
organisation_niveau_2 |
Organisatoriskenhedovermedarbejd |
Digitalisering MTM |
magistrat |
Magistratsafdeling |
Teknik og Miljø |
- Python 3.11+ (required by OpenOrchestrator 3.x)
- Dependencies (see
pyproject.toml):OpenOrchestratorOffice365-REST-Python-Clientrequests
[project]
requires-python = ">=3.11"
dependencies = [
"OpenOrchestrator>=3.0.0",
"Office365-REST-Python-Client>=2.6.2",
"requests>=2.34.2",
]The robot reads its credentials and settings from OpenOrchestrator. These must exist before the robot is run:
| Type | Name | Contents |
|---|---|---|
| Credential | OS2FormsAPI |
username = API base URL, password = API key |
| Credential | SharePointAPI |
username = tenant, password = client ID |
| Credential | SharePointCert |
username = certificate thumbprint, password = path to certificate (PEM) |
| Constant | AarhusKommuneSharePoint |
Base SharePoint URL |
Target site and list
- Site:
<AarhusKommuneSharePoint>/Teams/tea-teamsite12592 - List:
Tilmeldte medarbejdere
The Azure AD app behind the certificate must have write permission to the target site
(e.g. Sites.Selected granted with Write, or broader). Read-only access is not enough to
create list items.
- Install the dependencies (
pip install -e .or your usual workflow). - Create the credentials and constant listed above in OpenOrchestrator.
- Make sure the SharePoint app registration has write access to the target site.
- Configure a trigger that enqueues OS2Forms submissions and points OpenOrchestrator at this process.
-
Internal column names are not display names. SharePoint encodes spaces and special characters at column-creation time (
-becomes_x002d_,øbecomes_x00f8_, etc.) and truncates internal names at 32 characters — which is whyOrganisatoriskenhedovermedarbejdlooks cut off but is correct. Use theget_internal_column_names()helper to list the current internal names before changing the mapping. -
There are three columns displaying as "Magistratsafdeling" (
Magistratsafdeling,Magistratsafdeling0,Magistratsafdeling1). Writing to the wrong one succeeds without an error but lands the value in a column the view doesn't show. Confirm which internal name backs the visible column before relying on the mapping. -
Empty form fields come back as empty strings (
""), notnull. The robot skips empty values so blank fields are not written.