How to Create a Random Hashtag Generator
Do you want to pick a random hashtag or coupon or anything from a list and send it to another place like a Chatbot? Then this Integromat Tutorial is for you.
Watch this YouTube video or read the step-by-step guide below. 👇
Give your brain a break. Automate.
Did you know you can pick a random item from a list inside of Integromat or generate a random number? This article will show you exactly how you can create a random selector inside of Integromat with multiple ways and multiple options — from a very simple setup to a far more advanced approach where you can have a full dynamic list.
Table of Contents
- How to generate random hashtags
- How to upload to Dropbox, pick a random hashtag, and post on Instagram
- How to pick a set of items out of a full list of items
- How to pick one item out of a full list of items
How to generate random hashtags
Here is a sample scenario to demonstrate.
Inside the Set Variable module is a formula in the variable value that appears complicated, but I will go through it one by one.
Basically, in here are three different hashtags, #love, #instagood and #photooftheday, which are the top three hashtags on Instagram. You could randomly pick one of them when you post something to Instagram. So how can you do that? Do it by using the Integromat functions, floor ( ) and random together with the different values.
The second Set Variable is created specifically to demonstrate the random number output generated using the floor and random functions. Configure the variable value in this module accordingly so that you may see how the output looks like.
Replace the max value with the max number that you want to get and the min value with the min number you want to get. In this case, the max would be 3 because there are three hashtags that you want to look for, and the min value is 1.
This formula will generate a random number between one and three every time you run this scenario.
Next is the switch ( ) function. The switch function basically has an input value. If you hover over the function, you can see exactly its syntax structure.
It has an expression. In this case, the expression is the formula with the floor and random functions previously discussed, which created one random number between one and three.
When the random result is one, hashtag one will be used. If it’s two, then the second hashtag will be used. And if it’s three, then hashtag three. That way it will output a hashtag one, two, or three based on the random number generated from the previous formula.
Run the scenario to check the output and see how it looks.
So the random number generated in this case is 1. It then switched the value with the hashtag, #love.
The next step is to set up your Instagram.
Have your page connected. Add the photo URL that you want to post. Add your caption and the hashtag or use the hashtag that you generated before.
You could add a list of 100 hashtags in the random generator and it would still work and would always pick one of them. Just make sure that you increase your max items to whatever the amount of hashtags you’re going to use.
That’s it for the easy part.
How to upload to Dropbox, pick a random hashtag, and post on Instagram
The intermediate part is uploading new files in dropbox, picking a random hashtag, then posting it to Instagram.
For you to do this, use the Check New Files in Folder – Watch Files Dropbox module. This will trigger whenever there’s a new file inside of a specific folder.
The next module is the Get the direct image URL – Create/Update a Share Link Dropbox module. You will use its data inside of the Instagram module.
The Pick Random Hashtag/Item – Set variable Tools module is configured in the same way as what you’ve learned in the previous section about generating a random hashtag.
Finally, post to Instagram. Under Photo URL, use the Download URL data taken from the Get the direct image URL – Create/Update a Share Link Dropbox module, and under Caption, use the hashtag data from the Pick Random Hashtag/Item – Set variable Tools module.
Now this is all good, but usually on Instagram, you would want to have a full list of items, or pick a coupon code out of a full list of items randomly. Or you would want to randomly choose a winner.
How to pick a set of items out of a full list of items
Decide on how many hashtags you’d want to pick out of this list randomly. For example, five hashtags. These would be the ones you would use on Instagram. Also, make sure you’re not having duplicates. This is the way you can do this.
Based on the previous scenario, the first two modules remain the same. First is the Check New Files in Folder – Watch Files Dropbox module. Second is the Get the direct image URL – Create/Update a Share Link Dropbox module, which downloads the file.
Next is the Repeater, then pick a random hashtag, combine the hashtags all into one string.
Remove the duplicates with some advanced functions and payment functions. And then finally post it to Instagram with a complete list.
In the repeater, set the amount of hashtags you want to have in our list at the end. The initial value is always one, and make it repeat how many times you want to search or pick a random hashtag. It could be one. It could be 29, could be 3200, whatever. So of course it depends on how long your list is and the more hashtags you want to get, the more duplicates you might have. So in this case, it could be less than five if we set it to five. Because if there are two duplicates, we’ll just remove one.
You could probably expand the scenario to always make sure that you always have five hashtags. But as far as I know, that’s not good for the Instagram algorithm. You should have a variable amount of hashtags.
The next step is to pick random hashtags out of the list. How do you do that? Connect the Search rows Google Sheet module. Select Sheet one, which is in this case, the one with the ID and the hashtags.
Set it up to filter the ID, which is the first column equal to and then our random number. This is the exact same formula that was used before, which will generate a random number between one and 100. Replace the min and max values with whatever value you want to get out.
And the maximum number of return rows should only be one. And then it will give out one row where the ID is exactly the ID matching the random number.
The next step is to use the text aggregator module with the following settings.
Set the Repeater as the Source Module. Select Other as Row separation. And then input a space under Separator because hashtags are usually separated by space.
You could use a space and then the hashtag symbol (#), and this symbol would be added before every hashtag. But you’d have to make sure that the first word gets the hashtag as well, because it will only add the separator in between the words.
You don’t have to use the Group by. Uncheck stop the processing from an empty aggregation, and then map the hashtag out of the Google sheet.
The next module removes the duplicates. Make use of the Integromat functions which are super powerful. If you want to learn more about these, there’s the Integromat functions cheat sheet, which will guide you through all of the available Integromat functions.
As you can see, there are a lot of functions used in the scenario and these functions are absolutely free to use. They don’t count as operations. So I really recommend learning the Integromat functions and using them as much as possible. Now let’s get into the functions that are being used here.
First is to split up the text using split ( ). This creates an array. Use the distinct ( ) function on that array to remove any duplicates. Afterwards, join it back together using join ( ) into a text string separated by space. These three functions work from inside then outwards. So it’s first doing the split, then removing the duplicates and finally joining it back together. The final output is what you want to have on Instagram.
This is what you would have on the Instagram list.
You can also use that to mention people. So with the At (@) symbol, you can tag other people or other accounts and somebody already liked it. So yeah, that’s how you can use Integromat to create a random generator of items.
How to pick one item out of a full list of items
You could use this scenario to pick a random ID i.e. a coupon code. Using the Google sheet list, for example, add a coupon code.
Create another condition. Add another rule if Coupon Delivered is not equal to (case insensitive) Yes. This ensures that every coupon is only delivered once.
Create a separate Update a Row Google Sheet module to update the Coupon Delivered column with “Yes” every time the above module is run. By doing this people won’t get the same coupon code two times. So map the row number of the search module and under Coupon Delivered, type in “Yes”.
Always rename your modules. That’s a really good tip that I have for you to keep you organized as well as for the scenario names. Read more cool tips over here.
If you want to make the scenario even more dynamic, use the floor ( ) function inside of the Repeater to have a random amount of repeating. So if we copy and paste the floor ( ) function from the Tools variable, it would look like this:
This picks a random number between 11 and 29, picking that many hashtags out of the Google sheet. The same could go for the actual amount of items that you want to search from your list. So you can always map the values from previous modules where you’ve looked up how many rows you have first filled in your random hashtag generator, and then you can use that number to get a dynamic range you want to work with.
I hope that helped and you found a ton of value out of this article. By now you would know how to get random hashtags or create a random string generator. You can use that for any kind of string. It’s super easy to set up once you have understood it, and you can just use that for many use cases.
If you like all these set ups and want to learn more about Integromat functions, get the Integromat Functions Cheat Sheet, which explains everything you need to know about the Integromat functions and how they work.