How to store in a specific folder of Google Cloud Storage?

Aurelien
Google Developer Expert
Google Developer Expert

Dear Community,

I'm trying to store files in a specific bucket storage. 

Basically that works, but I have an issue with the path to the storage.

Here is my setting associated to my table:

Aurelien_0-1666853000500.png

So far, so good.

On the GCS part though, here is what I get:

Aurelien_3-1666854029479.png

But I would like to store the information in the green folder instead:

Aurelien_5-1666854211472.png

 

Is there a way to do so?

Many thanks in advance for your inputs !

Solved Solved
0 9 1,652
2 ACCEPTED SOLUTIONS

@Aurelien The only way I've found to handle this is to use an absolute path as in the following example:  "//[root folder name]/[subfolder name]".  Note the double slash is what creates the absolute path.  In GCS, it will reflect as [root folder name]>[subfolder name]> [photo name].  

The only issue is you currently can't do this globally.  You have to do this individually for each content field you want to send to GCS.  The good news is that this path sticks even through an app copy.  I hope this helps! 

View solution in original post

Aurelien
Google Developer Expert
Google Developer Expert

Hi @gborh1 

Thank you for your contribution, I forgot to update this post.

Indeed this is the solution I found, and it works for a bucket.

So that gave:

Aurelien_0-1678867117539.png

 

View solution in original post

9 REPLIES 9

 


@Aurelien wrote:

Basically that works, but I have an issue with the path to the storage.


I am not certain if the storage mechanism is different but...

Remember, when saving a file, AppSheet uses "relative pathing" based on; a) the location of the sheet as the "root" OR, b) if using a database, the app default path setting as the "root".

From that "root" location you have control of where the files go:

  1. If a generated file, you would specify the "target" pathing in the automation step.
  2. If an uploaded file, you would specify the "target" pathing in the File column definition.

Once the file is saved, to gain access to it through the app, the sheet or database must specify the "relative" path + filename.

 

Thank you @WillowMobileSys 

I will work on this and let you know how it goes ! I read on this section too...

Aurelien_0-1666886233367.png

 

I'll keep you posted, thank you for the tip ! 

OK, so I tried various things, here are the results of the tests:

Aurelien_4-1666891568930.png

 @WillowMobileSys you are correct: obviously, setting the default app folder has an incidence on the path.

However, the docId keeps being inserted on the way.

Would you have another idea?

@Aurelien The only way I've found to handle this is to use an absolute path as in the following example:  "//[root folder name]/[subfolder name]".  Note the double slash is what creates the absolute path.  In GCS, it will reflect as [root folder name]>[subfolder name]> [photo name].  

The only issue is you currently can't do this globally.  You have to do this individually for each content field you want to send to GCS.  The good news is that this path sticks even through an app copy.  I hope this helps! 

Aurelien
Google Developer Expert
Google Developer Expert

Hi @gborh1 

Thank you for your contribution, I forgot to update this post.

Indeed this is the solution I found, and it works for a bucket.

So that gave:

Aurelien_0-1678867117539.png

 

 

If you are running GCP and GWS, the recommendation is to use an Object Store.  Provides better security management and defaulting to assign any Table to be allocated to the store.   Creating a Service Account in GCP is the best practice to then leverage a private key to access the GCP bucket.  

Folder hierarchy appears to be managed within these Buckets by Appsheet for each App and Table.  Using this format for the last 8 months successfully 

 

Wim_V_1-1704765954519.png

 

Wim_V_0-1704765893728.png

Wim_V_2-1704766006275.png

 

@Aurelien  I am going to make an assumption that to do what you are currently doing, you have to open the GCP Bucket publicly or to the specific user account.  When creating Permissions to the Bucket, you will use a service account instead for all your Appsheets.   Otherwise you are creating a delegated access through a user account into GCP.   

Hello, I've a question

I'm trying to add a new store, and I'm getting this issue. 

HRagaz_0-1704731434046.png

Could you tell me how you did the connection? I followed the documentation about, and nothing.

Many Thanks

I get the same error when the Private key is not accurate.  Make sure you are using the correct key and the string is a clean cut and paste from what is provided by GCP when you create the Service Key.  No additional spaces for example. 

Top Labels in this Space