Create Expression to get doc type

  • 3 August 2015
  • 3 replies
  • 0 views

Badge +3
I need to get and use the doc type from attachments on my smartform. For example if the attachment's file name is "Test File.doc" I need to have ".doc" pulled back to use in another expression. I was hoping to be able to use an expression to do this. I can't use "right" and "3" because some files could end with four letters. In Nintex our group used "(?:[^/]*)$(?<=..*)" to get this data. Any help is greatly appreciated.

3 replies

Userlevel 5
Badge +16

Hi,

 

I managed to get the extension.

 

 

 add the following expression

 

12974i789911D8FBEEDFD7.png

 

 

wish this helps

Badge +3
Thank you, Mustafa, that did work!
Badge +3

Just in case anyone has this same issue, I'm adding some changes I had to make for finding the doc type. We have users who attach files with periods in the file names (ex. product name version 1.0 business case.docx). Using the previous solution would pull the 0 and %20 as the doc type. To fix this I added another hidden data label and added an expression (expLast4) to pull the last four characters [Right (File Name, 4)] and I changed the hdnDocType data label expression to replace the period (in case it was a doc type with only 3 characters) [Replace (expLast4, . , (Empty String)) and this resolved the issue.

Reply