Translate/replicate calculated value from Access/VBA in xls form

284
1
Jump to solution
03-27-2024 02:39 PM
MarkWasser
New Contributor II

Hi. Designing a Survey123 front end for a repeated, cyclic sampling that has been previously done w/ paper datasheets and entered manually into Access front-end with an Access back-end. New data collected in Survey123 moving forward will be appended/added to existing Access database after the field season. 

Looking to replicate a calculated value from Access in the Survey123 form. In Access it's generated with the following formula:

=Format(Now(),"yyyymmddhhnnss") & '-' & 1000000000*Rnd(Now())

This produces a combination of long strings with a dash and decimal based on the current date/time (first part) and a random number for the second part. An desired value would look something like this:

20240327063400-415188215.987833

 

Any help, thoughts, or advice on how to design this in my Survey123 form using xls connect? Ideally this would be a data field that is generated once per other set of repeating records (it'll be the same for all data values associated with an individual transect), would be done automatically in the background, and the front-end Survey user does not need to see it. Thanks in advance for any input. 

0 Kudos
1 Solution

Accepted Solutions
EvanR
by
New Contributor III

You can use a similar formula in a Survey123 calculate:

 concat(format-date(now(), '%Y%m%d%H%M%S-'),1000000000*random())

Here's the result that produced for me just now: 20240328080707-906436459.8550272

View solution in original post

1 Reply
EvanR
by
New Contributor III

You can use a similar formula in a Survey123 calculate:

 concat(format-date(now(), '%Y%m%d%H%M%S-'),1000000000*random())

Here's the result that produced for me just now: 20240328080707-906436459.8550272