Hello all,
How can I generate 20 random dates from last 14 days of current date?
Any solution?
Thanks in advance.
Hello all,
How can I generate 20 random dates from last 14 days of current date?
Any solution?
Thanks in advance.
Hi there,
There’s a few ways to do this here’s one solution for you:
Backend:
Go to your backend workflows and create a new api workflow
Call it like: generate_random_dates and set one parameter to key: counter and type: number
Download random number generator plugin and set the number to -1 → -14
Create a new thing in your DB for this example I created a data type data and created a field to be a list of dates. Here you want to add the following:
Current date/time +days: Result step 1 random number generator
Make it recursive:
Schedule the same API workflow and use the parameter + 1 to add to the count parameter then under only when choose “counter < 20” (It will run 20 times then stop)
After this then go to the frontend and do the following:
Frontend:
I then set a repeating group up for this example and this is what I got:
Hope that helps!
This topic was automatically closed after 70 days. New replies are no longer allowed.