Skip to main content
Nintex Community Menu Bar

How to delete file extension - Office365 Version

  • April 9, 2016
  • 3 replies
  • 145 views
  • Translate

Forum|alt.badge.img+16

Some it's needed to cut the file extension from a file name.

Here are 2 steps to do it.

We 'll use the actions named:

  • Regular Expression
  • Get Item From Collection
  • Log To History List ( to show results )

 

 

182444_pastedImage_3.png

 

Used Variables

     Use the following variables for this sample

 

182445_pastedImage_5.png

 

Action 1 - Regular Expression Action Configuration

 

Set the String attribute with your filename. In my sample I am getting it from a Sharepoint Column name named "ItemwithExtension"

Then set the String operation to "Extract"

 

The pattern used is [^/]*(?=.[^.]+($|?)) with ignore case checked

Finally set a collection variable ( varWithout2 in this case ) to get the results

Finally set a collection variable ( varWithout2 in this cae) to get the results

 

182446_pastedImage_6.png

 

 

Action 2 - Get Item From Collection

 

This action is set to extract he first value from the collection variable (varWithout2) and set the result on the variable named varWithoutExtension

 

 

182447_pastedImage_10.png

 

 

Action 3 - Log To History List

 

In my sample I wanted to view the results on the History list from a string with the value fhunth.photo.jpg and the results showed is fhunth.photo

182448_pastedImage_11.png

 

 

The result

 

182443_pastedImage_0.png

Forum|alt.badge.img+3

Hi, I'm trying to do this exact process with the On Premis version of Nintex.

However, when I attempt my Collection Operation to extract the first value (Action 2 above), I have no "Index" available from the dropdown

Capture.JPG

How do I do this or what am I doing wrong?

Thanks

Translate

Forum|alt.badge.img+16

Unfortunately you can't type in the index field, you will have to create a numeric variable with a default value and use that.

Translate

Forum|alt.badge.img+3

Thank you! this worked perfectly

I found I also needed to run a Collection Operation to sort the collection variable (ascending)

This then allowed me to use the numeric variable in the screenshot above (default value = 1) to select the correct value.

Thank you!

Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings