Creating a Dynamic Upload Folder - Basic

I recently added a basic dynamic upload folder for a table. In this example I created a path that creates a subfolder that is related to the primary key of the table. I added the following code to the Upload folder field of the Edit Tag screen.

"/_amsuploads/testimages/workorderID_" . $this->WorkOrderID->CurrentValue . "/images/"

The WorkOrderID is the primary key for the table. In this instance the folder structure allow for an individual row to have it’s own subfolder within the testimages folder. This helps organize the image files by work order. I used an absolute path by adding the forward slash at the beginning of the code.