Random string with javascript

Hi,

I found a javascript code for a random string, i’d like to use.
But somehow it doesn’t work in a code-node.
What do I have to do/change?

Thank you in advance
Martin

Hey @martin23,

When you say it doesn’t work what do you mean? Is there an error message maybe?

Oh, yes.
Sorry.

Perfect so there is a function in your node that is not being called so the node doesn’t return anything only to the console log.

I would recommend looking at our data structure so you can see what you need to return, it should ideally be an object.

Also, just to add to what @Jon said you can also generate random strings using the Crypto node, so you might not need custom code:

I tend to forget about it, but @BillAlex reminded me recently over here.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.