Grooper Help - Version 25.0
25.0.0017 2,127
  • Overview
  • Help Status

Path Expression

Embedded Object Grooper.Core

Defines an expression that generates the relative output path for an exported document.

Remarks

Overview

A Path Expression is used to dynamically construct the output path for exported documents. The expression can combine field values, document metadata, calculated values, or other information to generate one or more path segments. Either \ or / may be used as the path delimiter; the delimiter will be automatically adjusted to match the requirements of the target storage platform at export time.

Path segments are typically constructed using variables and expressions referencing fields declared on the export Content Type. These fields are exposed as variables and can be referenced by name within the expression.

Usage

  • Use string interpolation, composite formatting, or string concatenation to build the desired path.
  • You may use functions such as CleanFileName() to sanitize path segments.
  • The resulting path should not contain invalid or reserved characters for the target file system.

Example Expressions

Example 1: Merge the "Student ID" field, the "Semester" field, and the document type name into a path.

Syntax Example Expression Output Example
String Interpolation $"Enrollment\{Student_ID}\{Semester}\{CurrentDocument.ContentTypeName}" Enrollment\48783984\FALL-2021\Proof of Residence
Composite Formatting String.Format("Enrollment\{0}\{1}\{2}", Student_ID, Semester, CurrentDocument.ContentTypeName) Enrollment\48783984\FALL-2021\Proof of Residence
IO.Path.Combine IO.Path.Combine("Enrollment", Student_ID, Semester, CurrentDocument.ContentTypeName) Enrollment\48783984\FALL-2021\Proof of Residence
Concatenation "Enrollment" & "\" & Student_ID & "\" & Semester & "\" & CurrentDocument.ContentTypeName Enrollment\48783984\FALL-2021\Proof of Residence

Example 2: Merge the "State", "Well Name", and "Log Date" fields into a path.

Syntax Example Expression Output Example
String Interpolation $"Well Logs\{State}\{Well_Name}{Log_Date:yyyy-MM-dd}" Well Logs\TX\WELL0237_2020-05-15
Composite Formatting String.Format("Well Logs\{0}\{1}{2}", State, Well_Name, Log_Date.ToString("yyyy-MM-dd")) Well Logs\TX\WELL0237_2020-05-15
IO.Path.Combine IO.Path.Combine("Well Logs", State, Well_Name & "" & Log_Date.ToString("yyyy-MM-dd")) Well Logs\TX\WELL0237_2020-05-15
Concatenation "Well Logs" & "\" & State & "\" & Well_Name & "" & Log_Date.ToString("yyyy-MM-dd") Well Logs\TX\WELL0237_2020-05-15

Example 3: Use path segments from the document's import link.

$"{State}\\{CurrentDocument.ContentLink.FormatPathSegments(3, 5, "\\")}" Output Example: Texas\W363743\Drilling\Drilling Report 2020-07-17

Example 4: Sanitize or modify path segments.

  • Remove slashes: $"{CleanFileName(Manufacturer)}/{Appliance}"
  • Remove specific character: $"{name.Replace("*","_")}"

References

Best Practices

  • Always sanitize path segments to avoid invalid characters.
  • Test expressions to ensure they produce the expected output for all document types.
  • Use explicit formatting for dates and numbers to ensure consistent and predictable paths.

Used By

Notification