We have a rule that creates a new user after a node - 'student record' has been created. The node has personal details and we pass these to a new user.

The problem that we have is that we need a unique numerical number as a username, as we cant see another way to create a unique username, unless we can code something and do a reverse lookup on the name.

Does anyone know an easy way to get an incremental number / new users ID / something similar as a username in rules?

All the niggles are coming out and this has proved tricky for us...

Thanks

Chris

Comments

mcjim’s picture

This isn't the module you're looking for: http://drupal.org/project/user_import
But... it does contain some code to generate a unique username, which you may be able to borrow and repurpose.
Good luck :-)

chrispeat’s picture

I'm guessing that this would be done through a module / hook but im not sure where to start... im getting used to things in drupal but havent done something like this before (yet)?

Thanks, I think that you are right, it will certainly have some great code inside!

Any further tips on doing this would be great, and sorry for not knowing how to take this further myself. I feel like such a rookie at times....

Thanks all,

Chris

arla’s picture

How do you create users with Rules? I expected "Create new user" or similar in the action selector but there is none.