Overview
Bucket Folders allow you to define where files are stored in your AWS bucket.
...
S-Drive files are stored in AWS using a folder path that
...
, by default, contains the parent object record id (such as the Account record id) as the top level folder, as shown here.
...
Most users only interact with S-Drive files using the S-Drive user interface, so the
...
location of files in AWS is not important
...
. However if you want to see your files in the AWS bucket, it can be difficult to find them because of the way they’re stored.
Using a Bucket Folder makes seeing and organizing your files in AWS easier by allowing you to define the top folder of the path
...
Default Key field without Bucket Folder enabled
Let’s look at how files are normally stored in your AWS bucket.
The default path is as follows:
<record id of parent record>/<record id of file record>/<file name>
For example an Account File key would look like this:
0014K00000Mh786QAB/a004K000006Vpk6QAC/dog.jpg
0014K00000Mh786QAB is the Salesforce record id of the Account the file is uploaded to
a004K000006Vpk6QAC is the record id of the AccountFile record
dog.jpg is the file name
In the AWS bucket, the top level looks like this:
...
With Bucket Folder enabled
If you configure a Bucket Folder, the top level will be whatever you choose. The path will be
<your Bucket folder>/<record id of file record>/<file name>
The Bucket Folder is a field that you define. It can be a text field or a formula field or some other kind of field. For example, you can set it so that all AccountFiles have “Account” as the top level. You can define a picklist, a number field, etc. You can even configure a formula to use the Account name as the top level as shown here:
...
, as shown below.
...
Bucket Folders are very flexible. You can configure them as a text field, number field, picklist, even a formula field.
Setting up Bucket Folder
Setting up a Bucket Folder has two steps:
...
Create a field on the parent object to define the Bucket Folder.
...
Specify that field in S-Drive Configuration.
Creating a Bucket Folder field
The Bucket Folder field is defined on the file object’s parent. For example, for Account File, you must create a bucket folder field on Account. The exception is S-Drive Tab (S3Object), which we’ll get into below. We’ll use Account Files as an example here.
Go to Setup->Object Manager->Account
Go to Fields and Relationships
Click New to create a new field
Choose what type of field it is, such as Text, Formula, Picklist.
Give your field a name (ex: Bucket Folder)
You can choose a default value if you wish, or you can choose to populate the Bucket Folder field on each account you create
Once you’ve finished, click Save
Configuring Bucket Folder
Go to S-Drive Configuration General Settings Tab
Scroll down to Upload Settings.
Next to Configure Bucket Folder, click Configure.
This will open the following page:
The Bucket Folder Field is the field you created above. Fill in the field name and click the “Enabled” checkbox.
Click Save
Now when you upload Account Files, they will show in the bucket with the top level folder your specified
...
.