Select to view content in your preferred language

ArcGIS Field Maps- Arcade "DateOnly" function breaks entire Arcade expression in Field Maps popup

325
10
Jump to solution
2 weeks ago
Amanda__Huber
MVP Regular Contributor

Hello ArcGIS Field Maps Team, 

We recently observed an issue with the Arcade's "DateOnly" (https://developers.arcgis.com/arcade/guide/types/#dateonly ) function in your application.

When adding DateOnly to our Arcade expression the entrire expression does not display in Field Maps but does display in Map Viewer with no issues. Example below. 

Arcade Expression: 

Amanda__Huber_0-1726598948648.png

 

Map Viewer: 

Amanda__Huber_1-1726598971818.png

 

Field Maps: 

Amanda__Huber_2-1726599129831.png

 

 

When removing the DateOnly function, the Arcade expression works with no issues in Field Maps:

Amanda__Huber_4-1726599243015.png

 

 

Is this a known bug? 

 

Thanks,

Amanda Huber

 

1 Solution

Accepted Solutions
ChristopherCounsell
MVP Regular Contributor

Doug is correct in that you should not be using 'date' as a variable name. Just because it works in one part of the platform does not mean it will work elsewhere. 

DateOnly as a type and DateOnly() as a function are recent. Again Doug is correct that Arcade may not work across the platform. You can view a functionality matrix here:

https://developers.arcgis.com/arcade/guide/version-matrix/

Looking at the two documentation pages:

https://developers.arcgis.com/arcade/function-reference/date_functions/

https://developers.arcgis.com/arcade/function-reference/date_functions/#dateonly

They are both supported at Arcade 1.24 as core functionality. This aligns with version 200.3 of the ArcGIS Maps SDKs for Native Apps (what field maps runs on).

However it appears that the current release of Field Maps may be on an earlier version of the SDK. Referring to this post from July that states it's on 100.15:

https://community.esri.com/t5/arcgis-field-maps-blog/field-maps-and-utility-network-version-7/ba-p/1...

Clicking through Field Maps app 'about' it directs me to ArcGIS Runtime API for iOS and states current version as 100.15.6.

It seems that Field Maps is behind the platform when it comes to supporting Arcade. We'll likely get a major update in fall 2024 or 2025 that moves it to the 200.x SDK.

This is difficult but Esri is making steps in the right direction to have universal platform support in a common language and better documenting it (though I think they could do better with showing "Field Maps" on the arcade compatibility matrix instead of the SDK... it was a bit hidden here).

View solution in original post

10 Replies
DougBrowning
MVP Esteemed Contributor

See how it is underlining date as a var name on you.  I think its reserved and that is the warning.

Amanda__Huber
MVP Regular Contributor

Good eye, but date as a varible has not been an issue either way (works in field maps and map viewer), it's the 'DateOnly' that's the problem. 

0 Kudos
DougBrowning
MVP Esteemed Contributor

I would think it would make SDE Lite made and maybe cause the issue.  I would always fix a warning like that.

0 Kudos
Amanda__Huber
MVP Regular Contributor

Tested your theory and changed the "date" text variable to "dte" and still a no go, unfortunately it did not make a difference.

The "DateOnly" function is what's breaking this expression- 

Amanda__Huber_0-1726603380659.png

with date changed to dte FieldMaps still doesn't display the expression-  

Amanda__Huber_1-1726603435526.jpeg

Thanks,

Amanda

0 Kudos
DougBrowning
MVP Esteemed Contributor

Hmm have you tried specifying a format?

DateOnly("10 Jan 2022","D MMM Y")

Amanda__Huber
MVP Regular Contributor

Regardless of formatting, shouldn't Field Maps respect DateOnly as a valid function like MapViewer is?

0 Kudos
DougBrowning
MVP Esteemed Contributor

All kinds of stuff does not work across the platform.  Just posted this one too.   https://community.esri.com/t5/arcgis-field-maps-questions/relationships-0-fieldname-not-working-in-f... 

ChristopherCounsell
MVP Regular Contributor

Doug is correct in that you should not be using 'date' as a variable name. Just because it works in one part of the platform does not mean it will work elsewhere. 

DateOnly as a type and DateOnly() as a function are recent. Again Doug is correct that Arcade may not work across the platform. You can view a functionality matrix here:

https://developers.arcgis.com/arcade/guide/version-matrix/

Looking at the two documentation pages:

https://developers.arcgis.com/arcade/function-reference/date_functions/

https://developers.arcgis.com/arcade/function-reference/date_functions/#dateonly

They are both supported at Arcade 1.24 as core functionality. This aligns with version 200.3 of the ArcGIS Maps SDKs for Native Apps (what field maps runs on).

However it appears that the current release of Field Maps may be on an earlier version of the SDK. Referring to this post from July that states it's on 100.15:

https://community.esri.com/t5/arcgis-field-maps-blog/field-maps-and-utility-network-version-7/ba-p/1...

Clicking through Field Maps app 'about' it directs me to ArcGIS Runtime API for iOS and states current version as 100.15.6.

It seems that Field Maps is behind the platform when it comes to supporting Arcade. We'll likely get a major update in fall 2024 or 2025 that moves it to the 200.x SDK.

This is difficult but Esri is making steps in the right direction to have universal platform support in a common language and better documenting it (though I think they could do better with showing "Field Maps" on the arcade compatibility matrix instead of the SDK... it was a bit hidden here).

ChrisDunn1
Esri Contributor

@Amanda__Huber - this is the correct answer. The DateOnly() function is not currently supported in Field Maps. You can test out Field Maps built on the 200.x version of the Maps SDK, which includes support for newer Arcade functions, by following the instructions provided at the bottom of this blog post: https://www.esri.com/arcgis-blog/products/field-maps/field-mobility/whats-new-in-arcgis-field-maps-j...