How to delete file extension - Office365 Version

Workflow Veteran
2 3 3,406

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 )

Used Variables

     Use the following variables for this sample

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

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

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 and the results showed is

The result

Nintex Newbie

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


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


Automation Master
Automation Master

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

Nintex Newbie

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!