Select to view content in your preferred language

QuickCapture- Arcade Expression Issue Calculating "Current Year"- Bug?

766
7
Jump to solution
10-15-2024 08:40 AM
Amanda__Huber
MVP Regular Contributor

Hello QuickCapture Team, 

We're currently working on a project where we're trying to calculate the current year into our field when a button is pushed using Arcade Expressions. 

We have tested numerous ways of writing the expression and all return an empty result even though the Arcade expression editor shows the return to be correct. 

We have tried to return this as both a Number() and Text() to two respective small int and text fields with no luck. 

When testing in AGOL popups, our expressions work with no issues. Leading us to believe this may be an arcade version support issue. 

Expressions we've tried: 

Amanda__Huber_2-1729006503979.png

Amanda__Huber_4-1729006578964.png

Amanda__Huber_3-1729006531945.png

(This last one actually wouldn't allow the QuickCapture app to submit the record)

 

Please let us know if this is a Bug, Arcade version issue, or something else. 

 

Thanks,

Amanda Huber 

 

1 Solution

Accepted Solutions
JohnathanHasthorpe
Esri Regular Contributor

@Amanda__Huber - There was a bug in the mobile application. In the december release (1.21) we will have a fix for Text(Year(Now())) not returning a string version of the date.

This will resolve the issue that you were seeing.

View solution in original post

7 Replies
ChristopherCounsell
MVP Regular Contributor

DateOnly() is supported in Arcade 1.24 onward.

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

QuickCapture uses 1.18

https://doc.arcgis.com/en/quickcapture/help/arcade-expressions.htm

Do not expect Arcade to work universally across the platform. That may be the goal but newer stuff we use in core profiles like map popups takes longer to reach other parts of the platform.

0 Kudos
ChristopherCounsell
MVP Regular Contributor

Re reading the post it appears you're having issues with any calculation methods. Suggest trying with a new blank project (so it's easily reproducible) and reaching out to tech support if you haven't already.

0 Kudos
Amanda__Huber
MVP Regular Contributor

Hi @chrichris , 

Thanks for the response! To clarify, the documentation for Arcade Expressions in QuickCapture refers to DateOnly Fields not the DateOnly() function. That being said I now understand where you're seeing these version differences, sounds like the documentation is what is confusing. 

Amanda__Huber_1-1729090561256.png

It's still not clear why Date() and Year(Now()) are causing issues when submitting the record. 

Other expressions in the project are working fine and no issues which leads us to thinking it's just a QuickCapture issue with dates. 

We've opened an Esri support case already and plan to troubleshoot with them further. 

 

Thanks,

Amanda Huber 

0 Kudos
ChristopherCounsell
MVP Regular Contributor

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

The function DateOnly() is since version 1.24 and QuickCapture states it's on 1.18. So it would be both the fields and the function.

 

0 Kudos
JohnathanHasthorpe
Esri Regular Contributor

@Amanda__Huber - There was a bug in the mobile application. In the december release (1.21) we will have a fix for Text(Year(Now())) not returning a string version of the date.

This will resolve the issue that you were seeing.

Amanda__Huber
MVP Regular Contributor

This is good to know, thanks so much for the update. I'll keep an eye out for that release and do more testing then. 

 

Thanks again, 

Amanda Huber

0 Kudos
Amanda__Huber
MVP Regular Contributor

@JohnathanHasthorpe when will DateOnly() be supported by the QuickCapture mobile app? Is there an estimated timeline for this?

Our text field for date is a great workaround but not ideal for using other products like webmap and pipeline filters. 

 

Thanks, 

Amanda

0 Kudos