I need to parse out a string of numbers in a folder name. The format is always going to be “LastName_FirstName_00_00_0000_foldertype” with the 00_00_0000 being Month_Day_Year - the part I need separated. I feel like it should be doable because the numbers needed are the only numbers in the string but I just can’t seem to figure it out. Once it is extracted, I also need to format it to a standard date format of 00/00/0000
Page 1 / 1
Hi @nps_clt!
There are a couple of ways that you can do this:
Use regex to get the numbers from the string. This will be more flexible to changes in the rest of the text (eg if there is more than one first name), but it will also require an additional Formatter step to change the format of the number to the 00/00/0000 that you need. Obviously, this also requires a knowledge of how regex works (here’s a how to guide)
Use a split text step. This requires less technical knowledge and means that you wont need to add an additional date format step BUT it will go wrong if there are a different number of underscores in the text. For example if you have one input that’s firstname_middlename_lastname_00_00_0000_foldertype, that will break the subsequent steps.
For the second option, add a Formatter by Zapier step in your Zap and:
Select Text for the Event
Select Split Text for transform
Type an underscore in the transform field
For the Segment index, select ‘All (as separate fields)’
That will give you each piece of text in between the underscores as a separate field that you can use in a later step of your Zap.
Then, in your later steps, add each number from the dropdown choice and type a ‘/’ in between each one to create the date format that you need