Creating a subfolder using an expression for the FILE column

Struggling to get an expression working that will create a sub-folder based on the user’s ID. This is a subfolder to default based on Table name. Namely:

Table Documentation
Default folder for a ‘file’ is Documentation_Files
User ID is [PropertyUUID].[OwnerUUID] e.g: e60a348f

So the whole folder structure would look like:

Documentation_Files /e60a348f/a0c18248.File.174240.pdf.pdf

What actually gets created is:

Documentation_Files_/a0c18248.File.174240.pdf

DocumentURL expression
The reason for using default location is to make it easier to create generate the Document URL for this uploaded file, so the file can be referenced in a catalogue template report.

SWITCH( [FileOrURL],
“File”, CONCATENATE(
https://www.appsheet.com/template/gettablefileurl”,
“?appName=”, ENCODEURL(CONTEXT(“AppName”)),
“&tableName=”, ENCODEURL(CONTEXT(“Table”)),
“&fileName=”, ENCODEURL([File])
),

“Image”, CONCATENATE(
https://www.appsheet.com/template/gettablefileurl”,
“?appName=”, ENCODEURL(CONTEXT(“AppName”)),
“&tableName=”, ENCODEURL(CONTEXT(“Table”)),
“&fileName=”, ENCODEURL([Image])
),
“”
)

I have tried all manner of combinations of the following expressions for the FILE column and none appear to have worked:

  1. CONCATENATE("/",[PropertyUUID].[OwnerUUID], “/”)
  2. CONCATENATE([PropertyUUID].[OwnerUUID], “/”)
  3. CONCATENATE("/", [PropertyUUID].[OwnerUUID])
  4. CONCATENATE("/", “Documentation_Files”, “/”,[PropertyUUID].[OwnerUUID])
  5. CONCATENATE(“Documentation_Files”, “/”,[PropertyUUID].[OwnerUUID], “/”)

Any ideas as to what I am doing wrong?

0 8 291
8 REPLIES 8
Top Labels in this Space