Get the File Name

I am trying to get the PDF file name (2006-71213;829.894.pdf) as a value of a Data Field in my model. I have tried putting the Data Field on my Doc Type level and on the level above and have it inherited by the Doc Type specific Data Model. For context:



I can see the file name in the GUI. It is the value of the File Name attribute of the lease's parent folder:

I have tried a few variations of the expressions found on the Wiki at https://wiki.grooper.com/index.php?title=Expressions_Cookbook#Default_Value_Expressions, all to no avail. I know I have removed the file link, and that may make this more difficult, but I can't help but feel that it is still possible to accomplish.
SIDE NOTE: It would be cool to have a "Validate Expression" button on the Default Value Expression window so that the expression could be validated before closing that window.


I can see the file name in the GUI. It is the value of the File Name attribute of the lease's parent folder:

I have tried a few variations of the expressions found on the Wiki at https://wiki.grooper.com/index.php?title=Expressions_Cookbook#Default_Value_Expressions, all to no avail. I know I have removed the file link, and that may make this more difficult, but I can't help but feel that it is still possible to accomplish.
SIDE NOTE: It would be cool to have a "Validate Expression" button on the Default Value Expression window so that the expression could be validated before closing that window.
Kyle Souza
Data Wizard
P&P Oil & Gas Solutions
Data Wizard
P&P Oil & Gas Solutions
Tagged:
0
Best Answer
-
kylesouza Posts: 119 ✭✭
FIGURED IT OUT:
IO.Path.GetFileNameWithoutExtension(ParentFolder.AttachmentFileName)
Alternatively:
IO.Path.GetFileName(ParentFolder.AttachmentFileName)Kyle Souza
Data Wizard
P&P Oil & Gas Solutions0