Hi @Martinewski — When someone uses the file and then renames it, are they renaming the original file? Or are they making a copy of the file, changing it, and then renaming it?
I have a Zap that creates a copy of a template file before this. So, they're actually renaming the original file (which is not my template file, but a copy of it).
Hi @Martinewski! I wanted to swing back round on this to see if we can find you an answer.
Could I trouble you to clarify your last comment a little? You said that folks are renaming the original file, which is a copy, so I'm a little unclear.
Is this what's happening:
- You have a template file (File A)
- A Zap runs to make a copy of the template file (FILE 😎, that then becomes the new template
- The original 'template' file (FILE A) is then used as the file that's worked in
- When the updated file Zap runs, it's giving you the original name FILE A and not the updated name
Is that right?
Thanks for following up on this, @Danvers — I read the reply comment, but didn't have time that day to dig in further, and then clearly it slipped my mind.
My read of this was slightly different than yours (if I'm understanding your correctly), however. I took it to mean that at Step 3, it would be FILE B that is then used as the file that's worked on. But then I got lost completely as to what was triggering the "Updated File" Zap.
Hi @Martinewski! Are you still looking for some help with this? If so, could I trouble you to clarify what you are looking to do? Thanks!
Hey, sorry for the delay.
I have a Google Sheet A, which is copied to Google Sheet B. File A never changes, it's my template file. File B is created using a default filename.
When someone is going to use file B, they rename it. I need to receive this new filename.
@Martinewski This is a perfect use case for a Google Apps Script. You can create a webhook (doGet) and take the file ID from the webhook URL and get the file name and return it as a result. There are a bunch of examples of this on stackoverflow etc. what follows is theory code for Google Apps script, this is not tested and may error ... but it should get you started:
function doGet(e){
var ss=SpreadsheetApp.openById(e.parameter.sheetid);
var ssName = ss.getName();
var NameJSON = {'FileName':ssName, 'FileID': e.postData.sheetid};
return ContentService.createTextOutput(JSON.stringify(NameJSON) ).setMimeType(ContentService.MimeType.JSON);
}
then publish the script and it will give you a URL to call via a zapier webhook (GET) step be sure to add ?sheeetid=(the-file-id) to the end of the URL where you replace (the-file-id) with the actual ID of the file. This will return the file name to the webhook step in Zapier. .
Let me know if you need more help with this.