I'm doing a schema that includes 240 records with each record having a timestamp. How can I have the last record be the current time with each previous record 3 minutes apart? Can the date also be today, instead to selecting a actual date?
How to have timestamp using UTC with each timestamp 3 minutes apart with the latest being the current time?
How to have timestamp using UTC with each timestamp 3 minutes apart with the latest being the current time?
Hi @eddie_nunezt
Assuming you have the default row as id row number, then add a field of type formula and set the formula to be:now().utc-minutes((240-id)*3)
https://www.mockaroo.com/f0f93f40
How to have timestamp using UTC with each timestamp 3 minutes apart with the latest being the current time?
@mp_np , thanks for the suggestion. I wasn't able to get it to work doing that; do you happen to have an example schema?
How to have timestamp using UTC with each timestamp 3 minutes apart with the latest being the current time?
Hi @eddie_nunezt try https://www.mockaroo.com/f0f93f40 - I've set it to 100 so you can view it working in the preview, but just replace 100 with 240 in your example.
You need to scroll down to the bottom to check after you've run preview as you wanted the last to be now, and each previous 3 minutes earlier.
How to date entry with additional condition
Hi @shiv
- create Custom List with your status codes, named status
- create hidden date field for each random date you want to generate, named _dategen
- set entry date or expiry date as formula and enter the following formula:
case status when *['HB','ZZ'] then __date_gen else '' end
see example at https://www.mockaroo.com/14abaf70
Need help with below query
Try
case status when 'T-3' then date('09/01/2014') when 'A-3' then date('03/08/2014') when 'B-2' then date('02/10/2014')end
How to extract just the date part after adding some days to now()
@nhills
Use the .to_date function:
(now() +days(random(10,20))).to_date
see example:
https://www.mockaroo.com/ebbf8c50
How to extract just the date part after adding some days to now()
Excellent, thanks, just what I needed
How to have timestamp using UTC with each timestamp 3 minutes apart with the latest being the current time?
@mp_np , now I'm realizing why you mentioned "assuming you have default row as 'id row number'". It works well the way you used it, however, I'm working with a json object with an array that will include a UTC timestamp and value. I don't use "id" anywhere in my json formatting. Is there a way to do it in the "timestamp" for every item in my custom list as I have it here: https://mockaroo.com/schemas/109114 ?
How to have timestamp using UTC with each timestamp 3 minutes apart with the latest being the current time?
Hi @eddie_nunezt. To share a schema, you need to use the Share link which is below the download and preview buttons. Schemas under your own login look like this: https://www.mockaroo.com/schemas/108856
and can't be accessed by others unless you share the project with them. Share links look like: https://www.mockaroo.com/f0f93f40
However, I have modified my example to use a hidden row number field. Simply use 2 x underscore (_) in front of a field name and that field is hidden from view in the mock data, though you can use it in formulae.
So the row number field becomes:__id
Note, you could call this __row_number
for clarity in your own project
and the formula becomes:now().utc-minutes((100-__id)*3)
(replacing __id
with __row_number
if you change the name)
Here is an example that may work for you: https://www.mockaroo.com/492c9f30
Minutes & Seconds functions
Hello
Can you please show me how to use hours & minutes & seconds function
I need to extract these information from a date
Similar to year / month / day
Thx
Minutes & Seconds functions
Hi @jessejames3
Assuming your date field is called datetime (in my example I set this as a date wth SQL datetime as the type) then simply use:datetime.hour
datetime.min
datetime.sec
respectively. An example is here: https://www.mockaroo.com/451045f0
Is there a way to pick profile images from sites like uifaces.com?
bump. I am also interested
Is there a way to pick profile images from sites like uifaces.com?
This site has users with simple image urls - https://randomuser.me/photos
by converting the gender to 'men' or 'women' and adding a random number generator from 1-99 I've got an image URL. You may need to experiment as the highest I found for men was 91, and the highest for women was 94.
https://www.mockaroo.com/b34a2f30
They also have lego 1-8
Alternatively if you can download the mock data from one of the other sites, you can add as a dataset.
Concatenate string and GUID
Trying to figure out if I can concatenate a string and a GUID. Is there a way to use a guid in a formula?
Thanks,
Shay
Generate an ISODate value without the quote
How can I generate a template or function the returns a value like the sample below..
{"id":1,
"first_name":"Yanaton",
"last_name":"Kees",
"IsoDate": ISODate('2018-04-22T12:52:33.336Z')
}
NOTE: ISODate value not in quote.
Thanks!
Generate a JSON value
How do I generate a JSON value like below
{
"id":1,
"name": {
"full_name" : "Kees, Yanaton", // Mockaroo generated value using function/formula
"first_name" : "Yanaton", // Mockaroo generated value using function/formula
"last_name":"Kees" // Mockaroo generated value using function/formula
}
}
Thanks!
Generate an ISODate value without the quote
My bad - there is a MongoDB ISO function
How to have timestamp using UTC with each timestamp 3 minutes apart with the latest being the current time?
@mp_np , perhaps I'm not setting up my json arrays correctly? I have the parent object names "dataTypes" that only appears once, in that object I have a list that displays the value and timestamp. If you press "preview", this is exactly how I would like it to appear for the exception of the timestamp not doing what I would want it to do. Is there a way to add that formula using this schema I've created?
How to have timestamp using UTC with each timestamp 3 minutes apart with the latest being the current time?
Hi @eddie_nunezt - as your rows are within the JSON array, you need the rownumber hidden field to be within the JSON array so it increments.
See modified example of yours: https://mockaroo.com/624399a0