Search…
⌃K
Links

Google Cloud Storage

Upload files and images directly into your own GCS buckets.
When collecting binary data from your flows, such as images or documents from file, image upload, or signature questions, we upload them directly into your infrastructure from the responder's browser.
The answer associated with the question will contain the Object URL of the uploaded asset, such as https://storage.cloud.google.com/{{YOUR_BUCKET_NAME}}/{{FILENAME}}/
This way, you retain control over your responder's data: the GCS bucket can only provide write access to Formsort, so the data uploaded can be secure.
Other answers, such as emails or selected choices, will not be sent to the Google Cloud Storage (GCS) integration -- only binary uploads are placed there.

Setting up your Google Cloud Storage bucket

If you don't have an GCS bucket already, or wish to create a new one, set one up in the Google Cloud Console, taking note of the bucket name of the bucket.
Within your bucket, click Permissions and then Grant access and provide the Storage Object Creator role to the [email protected] user. This will allow us to upload, but not read data into this bucket.
Adding the Formsort user to Google Cloud Storage
Because Formsort will be uploading content directly from the browser and not via Formsort servers, you need to allow Cross Origin Resource Sharing (CORS) for this bucket. Please follow the instructions below
  • First, install the Google Cloud SDK CLI: https://cloud.google.com/sdk/docs/install
  • Login with 'gcloud init' command
  • Create cors.json file with the following example config. You can be more strict about the domain if you want, for example restricting it to *.formsort.app or the custom domain you have configured for use with Formsort.
[
{
"origin": ["*"],
"responseHeader": ["*"],
"method": ["PUT"],
"maxAgeSeconds": 3600
}
]
  • Upload the CORS configuration with gsutil cors set cors.json gs://{ YOUR_BUCKET_NAME }
  • You can confirm your CORS settings with gsutil cors get gs://{ YOUR_BUCKET_NAME }

Connecting Formsort to your bucket

Back in Formsort, in the integrations editor, under Google Cloud Storage, click Add new credential...
Provide your bucket name, and a description of the bucket and click Save bucket info.
At this point, you can return back to the flow you are working on, and add file, image upload, and signature questions, and the files will be placed within your bucket directly from your responders' browsers.

How Object URLs are generated

At the level of the flow's integration, a base path can be specified. This adds an additional prefix that is used to create Object URLs for all uploaded assets. One helpful trick is to create a base path like /prod for the production environment, to distinguish from assets uploaded to other environments.
At the level of a particular question, additional filename patterns can be specified:
Specifying a file destination
Take care that every URL has some uniqueness to it, whether it be the responder UUID, a timestamp, or random UUID, so that uploads from different responders do not overwrite one another.
In the above configuration, uploaded assets would be located at URLs such ashttps://storage.cloud.google.com/fils-test-bucket/file-ae87adcd-e3d3-4578-a9d5-3fa1e7052d1c-fixed.jpg, and is what would be provided in the answers stored in the flow itself.