Change "uuid" format to 8 digits?

Hello!

I send newsletters with Brevo.

I would like to assign to each Brevo contact a “unique id” composed of 8 digits, randomly.
Brevo support invites me to use Make.com

My question is: how can I generate “unique ids” via Make ? Could someone help me with this?

I have already created a scenario between Tally and Brevo, but on this one I am stuck.
Thanks!
C.

Hi @sal_media and welcome to the Make Community!

Every module can get a uuid generated by make:

It’s in the text and binary funcitions.

Hope that helps,

L

Thank you L !

I tried it and it works perfectly, thanks !

My problem now is that I need shorter uuid, for example with 8 digits (2 letters and 6 numbers, for example L57H4723.

And standard make.com uuid give me something like that : bfa9a259-6fc2-462c-983e-c703c5928049

Could anyone please help me :slight_smile: ?
Thanks a lot,
Chloe

Hi @sal_media,

One way would be to create your own by combining elements.

I don’t have time to test it out now, but you can use creative ways to do that.

For example, you could create a Python formula in make that generates a random string consisting of what you’re looking for.

You could assign combinations of letters for the first two characters (AA is Jan 1, AB is Jan 2, etc.) followed by the year (24) and a random, padded number (there is a random function in the math functions).

If you can’t figure out how to do any of that, leave a note and someone (even possibly me) will help out.

L

Hi L,

So kind of you to answer me, thank you very much!!

I don’t know how to do Python formulas; is there an easier way through Make.com directly, or to learn it easily?

Thank you for your idea which is very good; in fact I could opt for the following combination (8 digits) :

  • Month letters (A to L)
  • Month day (01 to 31)
  • 3 letters randomly (ex: TNF)
  • Year (24, 25, etc.)

Do you think you could help me with that, or something similar ?

Here is my actual scenario, enclosed.
Thanks
S.

Welcome to the Make community!

Yes, that is possible.

Output

Screenshot_2024-10-18_121503

This is just an example. Your final solution may or may not look like this depending on your requirements.

Module Export - quick import into your scenario

You can copy and paste this module export into your scenario. This will import the modules (with fields/settings/filters) shown in my screenshots above.

  1. Move your mouse over the line of code below. Copy the JSON by clicking the copy button on the right of the code, which looks like this:

  2. Enter your scenario editor. Press ESC to close any dialogs. Press CTRLV (paste keyboard shortcut for Windows) to paste directly in the editor.

  3. Click on each imported module and re-save it for validation. There may be some errors prompting you to remap some variables and connections.

JSON module export — paste this directly in your scenario

{"subflows":[{"flow":[{"id":249,"module":"util:SetVariable2","version":1,"parameters":{},"mapper":{"name":"id","scope":"roundtrip","value":"{{substring(upper(join(shuffle(split(replace(uuid; \"-\"; emptystring); emptystring)); emptystring)); 0; 8)}}"},"metadata":{"designer":{"x":1415,"y":-1628,"name":"Random 8-digit ID"}}}]}],"metadata":{"version":1}}

Note: Did you know you can reduce the size of blueprints and module export code like the above, using the Make Blueprint Scrubber?

Hope this helps! Let me know if there are any further questions or issues.

@samliew

P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.

1 Like

Woah !

Thank you so much ; I am very impressed, it works perfectly (see enclosed).

Do you think I need to apply my “rule” to protect me having 2 times the same ID generated ?

If I wanted to do this, could you please recommend me a guide or forum ?

  • 1 Month letters (A to L)
  • 2 Month day (01 to 31)
  • 2 letters randomly (ex: TN)
  • 2 numbers Year (24, 25, etc.)
  • 1 letter randomly (ex : K)

Today : J18TN24K

Thanks so much
S.

Your rule is more likely to generate duplicates.

Oh, why that ? With the combinaison of month + day + year, and 3 random letters, I thought it was a good option to protect me. Do you have another idea for a 8 digits uuid that limits duplicates ?

This is because you are limiting the number of possible combinations with your rules.

@samliew you’re right ! I will follow your suggestion. Thanks a lot

It seems that with your solution I have a 8 digit code with 5 numbers and 3 letters ; would it be easy to have 5 letters and 3 numbers ?

Thanks

One thing to consider (if you’re using the date/month/year) to create your uuid is the number of entries you expect to get in a single day. If you’re expecting 5 entries per day, and you hav 3 random letters, that’s not a big deal and your option would work. If you’re expecting hundreds of entries per day, then it no longer works because your pool of numbers (26 x 26 x 26) may not be enough. You want a significan number of slots to make it highly improbable that you’ll get duplicates.

Of course, there are other ways to do that. If everything is self-contained in your make scenario, you could manage the entries in a data store within make.

Basically, what I’m saying is: ther are many (!!) way to accomplish what you’re trying to do. The best (or the apporpriate) solution requires understanding what you’re working with. We don’t have that knowledge, but you do. So work on that part of the scenario (how many entries will I get per day/month/year) to figure out a uuid approach that will work for you.

L

Hello L,

Thanks, indeed I had the same thought, that’s why I’m going to start with 8 random digits.
I plan to have about 100 subscribers per day, so it’s safer.

But rather than having 5 numbers and 3 letters, as proposed by samliew’s solution (which works very well!) I would have preferred to have 5 letters and 3 numbers.

Do you know how to adjust this on the Make module?

Thanks, have a nice day,
S.

No problem, glad I could help!

1. If anyone has a new question in the future, please start a new thread. This makes it easier for others with the same problem to search for the answers to specific questions, and you are more likely to receive help since newer questions are monitored closely.

2. The Make Community guidelines encourages users to try to mark helpful replies as solutions to help keep the Community organized.

This marks the topic as solved, so that:

  • others can save time when catching up with the latest activity here, and
  • allows others to quickly jump to the solution if they come across the same problem

To do this, simply click the checkbox at the bottom of the post that answers your question:
Screenshot_2023-10-04_161049

3. Don’t forget to like and bookmark this topic so you can get back to it easily in future!

Hope this helps! Let me know if there are any further questions or issues.

@samliew

P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.

2 Likes

Thanks @samliew !

You’re right, I will start a new thread with my specific last question.

And, I thank you very much for your help & solution !! :yellow_heart:

S.