NOTE: This video was originally created using the Integromat platform (the predecessor of Make.com), however the principles shown in this video apply to Make (formerly Integromat).
When you need more than Free Integromat Support: https://weblytica.com/integromat/
😍Love this video? Leave me a tip: https://weblytica.com/tip/
Video Transcript
Hello, my name is Andy O'Neil and I'm going to do a quick, how to video looking at the SubString Function of Integromats. So first of all, let's look and see what the SubString does. Basically, the SubString is you can take one of your variables and cut a section of that variable into pieces by character count. And we have an example here. This is from the Integromat support page. We see SubString here and our R value is hello. And if we have zero and three, there's a start number and an in number for the position of your text. So zero and three in the word hello, gives us the letters AGL. If we do one and three we get EL so it starts at character one and goes to three, which only gives us two characters. So I've got four examples here.
We're going to do an Integromat. I have a list of audio file names here that we're going to reuse for these four examples. And in this first one, we're going to extract the first five characters and it's going to be very similar to this. It's going to be a zero and a five for our two numbers. The next examples we're going to extract the last five characters. Now this is a little trickier because we don't know the length of our string. So we have to calculate that and back, do a little math in our function. The next thing we're going to do is we're going to extract the file extension. So this assumes there's only one dot in the file name, which is prior to the file extension. And so we're going to separate it there to get those you'll note, this one has four characters so our count won't necessarily.
We can't set that at three characters, not every file extension is three characters. And then on this one we're going to do the opposite of that, we're going to extract the file name again. This is assuming there's only one dot in the file name that separates the name and the extension. So let's go over here to Integromat and what I've done, I've just put a CSV step here. Here's our four file names. And I've given the column this is a one column CSV file. Basically, we're just parsing this so we can run it for our functions. So our first function up here is to get the first five characters. So right here, you can see here's our SubString. We added the file name here which means that is the value we want to split up. And then we're doing a zero and a five.
So this is going to give us the first five characters of our file name. So I'm going to ahead and run this again. And we'll look at... I've done a text aggregator here that just adds these together so we can see them. So there is the first five characters of each of our file names that we started with over here. Pretty straightforward. Now, the next thing we want to do is we're going to look here at getting the last five characters. So this is a little tricky a little more tricky. I'm going to put these on different lines so that we can kind of separate this out. So here's our SubString Function. Here is the value we want to use and our colon, and here's our closing parentheses for the SubString. So now here are two values. Now normally these are numerical values. In our first example, we did zero and five, but in this case, we want to get the last five characters.
So what I've done is I've nested a function here called length. And so length, you give length they string, and it will count and tell you how long that string is. And so what we've done here is we've said we want the length of the file name, and then we use the minus, we use a subtraction from our math function. You can't just put a subtract in from your keyboard. You need to go to the math functions and do the minus sign five. So this is going to say, find the length of our string and whatever that is, back it up five characters. So that's going to be our starting point. And then our ending point is the length of the string. We want this to get the last five characters. So our first character is going to be five less than the length.
And the second number is going to be the length. And so that will, regardless of the length of this string, get us the last five characters of the string. So if we go over here and look at our result you can see one, two, three, four, five, five characters. Here are the last five characters of each of those file names. Now if we're looking at file names, obviously this isn't terribly helpful. This might be helpful with something else. So now let's look at how we get the file names only. So let me go back here and do the same thing.