Conversation
BlueRose Technology
NL
Last activity: 22 Jan 2026 10:27 EST
I need to attach a document on a case specific sharepoint site in constellation application.
I need to attach a document on a case specific share point site in constellation application.
Problem statement: In constellation application, I have attachment field and it is triggering the share point integration but it is failing as we have one share point site per case which has structure as "BaseURL/Domain/Org/CaseID". Org and CaseID value are coming from my current case. In constellation we attachment any document then we lost the case context due to thread change and it doesn't make the site URL properly. I think this is wider issue for the projects which are using share point with dynamic structure of site. Is there any solution which can be used to overcome this problem.
-
Reply
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Pegasystems Inc.
GB
@Rahul Toky have you seen this from @Giovani? You don't have access to action sets in Constellation but the attachment infrastructure is the same for all pega application, you'd need to look at intercepting or extending repository API's to do this
https://support.pega.com/discussion/implementing-custom-repository-exte…
Pegasystems Inc.
US
Hi @Rahul Toky
Quick clarification:
- Are you using the SharePoint Online Integration component from Pega Marketplace, or planning a Custom Repository?
- Is the target SharePoint Online (Microsoft 365) or on‑prem?
Either way, here’s how Constellation handles attachments and how you can implement case‑specific storage and metadata.
How Constellation’s attachment flow works (two phases)
When users attach a file with the Constellation Attachment utility / DX APIs, the platform runs a two‑phase process:
Hi @Rahul Toky
Quick clarification:
- Are you using the SharePoint Online Integration component from Pega Marketplace, or planning a Custom Repository?
- Is the target SharePoint Online (Microsoft 365) or on‑prem?
Either way, here’s how Constellation handles attachments and how you can implement case‑specific storage and metadata.
How Constellation’s attachment flow works (two phases)
When users attach a file with the Constellation Attachment utility / DX APIs, the platform runs a two‑phase process:
- Upload – the client calls the
/attachments/uploadendpoint; Pega accepts the stream and stages the file on the server. This step does not have case context yet. - Attach (link to the case) – the platform then creates the
Data-WorkAttach-Fileinstance and links it to the case; here you have full case context and can run your mapping and repository logic (e.g., set folder path, enrich metadata, call external APIs). ThepyDefaultonData-WorkAttach-Fileis the canonical hook for metadata mapping and invoking your repository connector.
In our client pattern, we add an extension data transform (e.g.,
Map*Metadata) that runs in the work context during phase 2 to collect the right case properties (IDs, customer keys, classifications) and pass them to the repository API. We’ve also used a “final attachment” page parameter handed off bypyDefaultto the extension mapping logic.
Option A — Using the Marketplace SharePoint Online Integration component
If you’re using the Marketplace connector, you’ll configure an app registration and auth profile, then call the component’s rules to create folders/files and set metadata. Be aware that SharePoint Add‑in/ACS app‑only auth is being deprecated by Microsoft; for new tenants (since late 2024) and upcoming timelines for existing tenants, prefer Microsoft Graph (Azure AD) app registrations. If the Marketplace component in your stack relies on ACS, plan a Graph upgrade path.
Alternative: there’s also a Marketplace component that integrates SharePoint Online via Microsoft Graph API if you want a Graph‑first path.
High‑level steps with the Marketplace connector
- Install and enable the component in your app.
- Register an Azure AD app for SharePoint Online; configure scopes and the Pega Authentication Profile accordingly (no hard‑coded secrets; use DSS/App Settings).
- In phase 1 (Upload), accept the file as usual.
- In phase 2 (Attach), call your mapping DT from
Data-WorkAttach-File.pyDefaultto compute site/folder path (e.g.,/sites/<BusinessUnit>/cases/<pyID>), set desired metadata, then invoke the component’s create/move/update operations.
Option B — Custom Repository
If you need full control over foldering, metadata, and lifecycle (and to stay upgrade‑safe with Constellation), implement a Custom Repository and let the platform route all attachment operations through it.
1) Define the repository type
- Create a child class of
Embed-Repository-Type-Custom-<YourRepo>; overridepyRepoConfigurationand the extension activities you need (pyPublishArtifact,pyFetchArtifact,pyBrowseArtifact,pyPingRepository). - Extend
Code-Pega-List.pyRepoTypesto register your type.
2) Create a Repository rule & wire the app
- Records ▸ SysAdmin ▸ Repository → create your repository (auth, endpoints, base directory).
- In the Application rule ▸ Integration tab, set Content storage to “Store in repository” and select your repository.
3) Hook into the “Attach” phase for metadata
- In
Data-WorkAttach-File.pyDefault, call your extension DT (e.g.,Map*Metadata) running in case context to collect keys (Case ID, customer identifiers, document class), and pass them to the repository API. - We’ve successfully used a “final attachment page” parameter handed from
pyDefaultto the mapping DT, which your repository activities consume when creating content.
4) Implement SharePoint‑specific operations
- Upload (phase 1): write to a temporary folder or use Graph’s upload session if you’re going direct to SharePoint.
- Finalize (phase 2): create/move to the case‑specific folder and apply metadata; return the external file ID to store on
Data-WorkAttach-File.
-
Mohamed BOUANENE
BlueRose Technology
NL
@Giovani Thanks for your response.
1. Are you using the SharePoint Online Integration component from Pega Marketplace, or planning a Custom Repository? -- Yes we are using the SharePoint Online component integration from Pega Marketplace.
2. Is the target SharePoint Online (Microsoft 365) or on‑prem?-- As far my knowledge we are on prem and will be moving to Online in near future.
Also, regarding the 2 Phase approach we have tried this in another constellation application where we have selected Pega Cloud as repository in the first place to attach the temp file on Pega cloud storage which is during Upload phase of the document and then during Attach phase when we have the case context we are uploading it on SharePoint. The problem with this approach is it is not aligned with client policy on using pega cloud storage. So we want to change this design to get a solution which is more aligned with client policies.
Moreover, I am looking for a solution where I can use the SharePoint as document repository and can get the case context during the Upload Phase or if there is solution which can bypass the Upload Phase and directly go to the attach phase.
Pegasystems Inc.
US
@Rahul TokyIf you are not allowed to temporary upload the file on Pega cloud repository, you can directly upload it to a temp folder on Sharepoint and later in the attachment phase you move to desired folder, like this you will not keep any files on Pega side.
For having access to work context during upload you would need to request an enhancement to Pega platform.
-
Mohamed BOUANENE Sander Schouten
Pegasystems Inc.
US
@Rahul Toky, our product team is working to expose the ContextID in the Upload phase as well, Changes are in progress for 25.1.2 and the fix is being backported at least up to 24.2.x
-
Rahul Toky