Skip to content

[CSV Exporter] File Name Customization #353

@Juiced66

Description

@Juiced66

Description:

Allow users to specify the filename of the exported CSV. Update the exportMeasures function to accept a fileName parameter and configure the response headers accordingly.

Tasks:

  • Update exportMeasures functions to accept fileName parameter.
  • Configure response headers to use the specified fileName.

Example Code:

const fileName = request.getString("fileName", `device-${new Date().toISOString()}.csv`);
request.response.configure({
  headers: {
    "Content-Disposition": `attachment; filename="${fileName}"`,
    "Content-Type": "text/csv",
  },
});

Pros:

  • Allows customization of the exported file name.
  • Improves user experience by providing meaningful filenames.

Cons:

  • Adds an additional parameter to manage.
  • Potential for filename conflicts if not handled properly when requesting.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions