Arcade Expressions Wont Calculate

509
4
05-15-2024 06:45 AM
DaveK
by
Frequent Contributor

Hello!

I'm creating a Field Maps app for data collection. I have a unique ID field that I would like auto calculated based on the time down to the millisecond. I'm using an Arcade expressions for this. The Now() function doesn't get does that far but if I use Time(Now()), then I do get milliseconds. Unfortunately, this function as well as many others don't see to calculate in the Field Maps app. Is this typical behavior? Should I be formatting my Arcade expressions in another way to allow them to work? Any help is appreciated. 

DaveK_0-1715780667694.png

 

DaveK_1-1715780701813.jpeg

 

 

Thanks. 

0 Kudos
4 Replies
ChrisDunn1
Esri Contributor

Hi @DaveK ,

The Time() function is not yet supported in Field Maps, it will be in a future release.

In the meantime, you can format the timestamp to get miliseconds using:

 

return Text(Now(), 'dddd, MMMM D, Y @ h:m:s:SSS')

 

Note that the "SSS" for milliseconds is case-sensitive and needs to be capitalized.

I hope that helps!

Chris

JamesTurner2
Regular Contributor

@ChrisDunn1 Is Time() supported yet? I am trying to convert a dateTime to a time. It works in the web map, but fails to calculate in mobile. 

0 Kudos
ChrisDunn1
Esri Contributor

Hi @JamesTurner2 ,

The Time() function is not yet supported. It will be included in the updated version of Field Maps that is currently in development and will be released at some point later this year. The end of this blog announcement has details on how to join the Tech Preview for the new version, the Time() function will work in the Tech Preview.

https://www.esri.com/arcgis-blog/products/field-maps/field-mobility/whats-new-in-arcgis-field-maps-n...

Chris

0 Kudos
JamesTurner2
Regular Contributor

Thanks, in the meantime, your Text() solution worked for me - it just took me a while to isolate the issue to the Time() function. I appreciate the response!

0 Kudos