Unable to Set Dynamic File Name While Downloading a Template in Pega Constellation

Hi Team,

We have a requirement to download a template from the UI in Pega Constellation.

We have implemented the following approach:

  1. Stored the static template in Pega as a Binary File rule.
  2. Created a field of type URL.
  3. Created a read-only partial view to display the URL field.
  4. Added the partial view to the required location in the UI.
  5. Created a Data Transform to populate the URL property using the Binary File rule’s directory and file name.
  6. Invoked the Data Transform to generate the download URL.

With this approach, the file is downloaded successfully. However, the downloaded file retains the name defined in the Binary File rule.

Requirement:
We need to generate the downloaded file name dynamically in the following format:

<CaseID>_<CurrentDateTime>.<extension>

Example:
Temp-12345_20261030_103345.xlsx

Could you please guide on how to dynamically set the downloaded file name while continuing to use the Binary File/URL-based download approach in Pega Constellation?

Regards,

Suchita Deshmukh

You cannot reliably change the downloaded filename while using the direct Rule-File-Binary.DownloadFile URL, because the browser uses the Content-Disposition header supplied by Pega, and that header reflects the Binary File rule’s stored filename. To use Temp-12345_20261030_103345.xlsx, you need a custom download endpoint/activity that streams the Binary File content and explicitly sets Content-Disposition with your dynamic filename.

Can you try to replace the direct URL field with a custom download endpoint that accepts Case ID, opens the Binary file to build a dynamic file name and streams the binary file content to browser?

This avoids creating a copy of the template for every case and still lets each user download it under a case-specific name.