Select to view content in your preferred language

Date formatting issues

756
1
Jump to solution
06-06-2023 11:55 AM
MatthewMorehead
Emerging Contributor

I am trying to format the date in my survey into YYYYMMDD so that it shows up nicely in my instance_name setting field. I am currently trying to use the following formula to format the date in the calculation line of my date question :

format-date(${DATEOFSURVEY}, '%Y: %n: %e')

Connect keeps returning an error saying it is "invalid"

XLSForm is attached, any help is appreciated.

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
ZacharySutherby
Esri Regular Contributor

Hello @MatthewMorehead

The issue is due to the calculation being in the same line as the date question. This causes a circular dependency loop as a question cannot be calculated with it's own value. 

If you don't need the formatted date stored in a field in the feature service you can take the same calculation and place it in the concat() function within the instance_name column. If you do want the formatted string in a field in the feature service you can add a calculate question following the DATEOFSURVEY question and reference that calculate question in the instance_name. 

Thank you,
Zach

View solution in original post

0 Kudos
1 Reply
ZacharySutherby
Esri Regular Contributor

Hello @MatthewMorehead

The issue is due to the calculation being in the same line as the date question. This causes a circular dependency loop as a question cannot be calculated with it's own value. 

If you don't need the formatted date stored in a field in the feature service you can take the same calculation and place it in the concat() function within the instance_name column. If you do want the formatted string in a field in the feature service you can add a calculate question following the DATEOFSURVEY question and reference that calculate question in the instance_name. 

Thank you,
Zach
0 Kudos