Passing Environment Variables / User Data to Collabora Online

Is there a method to pass environment variables to a collabora instance, when opening a file for editing, to make them available inside the document?

It would be very helpful if Nextcloud Office for example could pass user attributes (like Name, E-Mail, Address, etc…) to collabora online when opening a text document, like a letter template, so they become available inside the document and could be auto-filled.

If this feature is not present right now, I would write a feature-request.

Hey @alimmroth Welcome to colabora online forum

@alimmroth nice idea — and good news, the building blocks for this mostly exist already, just not as a one-click feature yet :slight_smile:

The “environment variables into the document” part isn’t really how it works, but the underlying need (user attributes available inside the doc) can be done through the WOPI protocol. A couple of angles:

1. WOPI CheckFileInfo already carries user data. When the integration (Nextcloud Office) opens a file, it talks to Collabora over WOPI and sends a CheckFileInfo response that includes fields like UserFriendlyName, plus UserExtraInfo and UserPrivateInfo for arbitrary extra attributes. So the host (Nextcloud) is the right place to inject Name / E-Mail / Address etc. The limitation today is that Nextcloud Office only populates a subset of these, and there’s no built-in mapping of “user profile field → document field.”

2. Auto-fill inside the document is a separate piece. Even with the data flowing in, something has to drop it into the letter template. The realistic paths are: document fields/placeholders filled via a macro, or the new content-control / form-field features. There isn’t a turnkey “merge my profile into this template on open” flow right now.

So short version: the data transport exists (WOPI user info), the auto-fill-into-template glue is what’s missing. A feature request is absolutely worth filing — I’d frame it as “map Nextcloud user profile attributes to document fields/placeholders on open” rather than “pass env variables,” since that’ll land better with how the WOPI flow actually works. The Nextcloud richdocuments repo on GitHub is probably the right place for the integration side, and engine Collabora for the templating side.

Hi darshan, thank you very much for your valuable reply! :slight_smile: I will likely file requests on both ends, so this can hopefully be made possible.