function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Alisa ZhurovaAlisa Zhurova 

how in process builder use formula random number?

Hi, I to create process builder and I need to create random number?
Help me, please
 
MATH.ROUND(MATH.RANDOM()*1000)
 
In this formula no correct function Math.random(
 
Suraj Tripathi 47Suraj Tripathi 47

Hi Alisa,

This is not possible through process builder or formula field.To generate random number you need to use apex class

Integer lenUpto = 5;
String str = string.valueof(Math.abs(Crypto.getRandomLong()));
String randomNumber = str.substring(0, lenUpto);
system.debug('Random Number::' + randomNumber);


Please Mark it as Best Answer,if it helps.

Thanks

fvdbfd vfdbdffvdbfd vfdbdf
I think you have to take guide from here (https://corwebdigital.com/) to solve this issue because there are so many formula number solution are available there.
Neil FieldNeil Field
It's an interesting task, I've never encountered it before. I had problems with the math and often used the service https://plainmath.net/math-solver with math solver for my homework. Maybe it will be useful because you can use the part with the code from this resource and try to adapt it to your needs.