Select to view content in your preferred language

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

563
12
Jump to solution
09-17-2024 11:54 AM
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

12 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).

Amanda__Huber
MVP Regular Contributor

Hi @ChristopherCounsell

Thanks for your response! This is a very helpful explination and thanks for pointing out how to discover each version. That being said, is there a more straightforward resource to determine what version of Arcade each Esri app is on? We're running into another example of this, but unclear why. This time Field Maps won't even submit the point it just keeps spinning and spinning (when editing in AGOL no issues)- 

  • FeatureSetByPortalItem() is running on 1.8
  • Intersects () is running on 1.3
  • First() is on Core
  • !IsEmpty() is on Core

Amanda__Huber_0-1730215674763.png

Also to clarify and make sure I'm understanding this right-
Since you mentioned Field Maps is on SDK version 100.15 does this mean that it's only using Arcade version 1.19? 

Amanda__Huber_1-1730215830262.png

Thanks so much for helping me understand this, still learning new things about arcade compatibilities!

 

Best, 

Amanda Huber

 

0 Kudos