Customize filenames in Zapier
In Zapier, you can customize the filename for your screenshot when it's saved to an Action like your connected cloud storage account.
⚠️ Not all filename formats may be supported in your cloud storage account. Please check the documentation of your connected account first.
There are a couple of options to choose from:
- Original filename
- Custom filename
Please see the Stillio Webhook API Docs for detailed info.
The original filename, as it is stored in the Stillio architecture, should be safe to used on most file systems but does not contain any information about the webpage or date it has been captured. It is represented in the webhook payload by the field
as:object.schema:identifier and may look something like
c268d9c0-3902-11e9-a49d-9728950eb84f. If you add
.png you get a file system safe filename (c268d9c0-3902-11e9-a49d-9728950eb84f.png).
If you prefer the filename to be descriptive and informative, you can create a custom filenaming format. You can script your own format, or use our example below.
For this example, we use the Code action in Zapier.
Save + Continue
The nerds at Stillio love filenames that show both a timestamp - starting with yyyy-mm-dd as sorting alphabetically sorts on date - and the title of your webpage(s) in a format that it's safe to use on most file systems. Before adding the script, you need to tell Zapier Code which fields to use from the webhook payload:
You need to define the fields
dateCreated exactly like this as they are being used in the Script below:
The above is just a smaller piece to show what it looks like. The full script can be copied here.
Test your code
In the next step you can perform a test to see if the script does what's needed.
Looks good to me! Note that it doesn't include the filetype extension .png at the end, as some cloud services automatically use it from the input file. You can always add it yourself in the template of the service you are syncing to.
Sync files with custom filenames
Next, we want to use the custom filename in the file service we are syncing to. In this example, we sync our files to Box. If you have setup that Action before, you can simply change the settings in the template. If you have not yet added the Box app, you can combine the settings below in the Box tutorial.
Add or change your Box template to use the custom filename:
In the Box tutorial we left the optional Name field blank, as then it would default to the filename from the source. Now we have scripted a custom filename, we can define it here in the Name field. Here, we combined two parts: The domain from the Webhook (Zapier Step 1) and the custom filename from the Code (Zapier Step 2).
As Box doesn't allow subfolders to be created, so in this example we used the domain (Step 1) as first part of the filename with a '-' separator for the rest. For services that do support subfolder creation (like OneDrive and S3) you can use a '/' as separator to create a custom folder structure based on domains or year/month, whatever you prefer.
The resulting screenshot now has the desired filename. 🎉