can we add this to the current Code.gs or can we make a new .gs file for it ?
>
You can use either approach, because Google Apps Script automatically combines all .gs files in your project into a single global namespace.
Here is how they compare:
Option 1: Add it to the existing Code.gs
Pros: Everything stays in one place, making it quick to find if your project is relatively compact.
Cons: Code.gs can get long and harder to scroll through if you add many features.
Option 2: Create a new .gs file (e.g., ProfileExport.gs)
Pros: Keeps your project modular and clean. You can separate user authentication logic from profile and export features. All .gs files can still freely call functions from each other without extra imports.
Recommendation: Feel free to create a new .gs file to keep your code neatly organized, or paste it right at the bottom of your existing Code.gs—both will work seamlessly!