Survey123 Instance_name and date

4259
9
Jump to solution
06-16-2017 11:22 AM
by Anonymous User
Not applicable

I am trying to set up an instance_name using the date field.  The formula I'm using is  concat("Observation ", ${Date}).  I want it return "Observation June 16, 2017" but it is returning:

How can I format this to show month/day/year?  Thanks

1 Solution

Accepted Solutions
JamesTedrick
Esri Esteemed Contributor

Hi Amy,

Please look at the format-date function within Formulas—Survey123 for ArcGIS | ArcGIS  .  This will allow you to generate a human-readable text from the date value.  For example, to get an ISO day, you can use

format-date(${date_question}, '%Y-%m-%d')

View solution in original post

9 Replies
JamesTedrick
Esri Esteemed Contributor

Hi Charleen,

Please take a look at the date-format function: Formulas—Survey123 for ArcGIS | ArcGIS  (it's the section just above the page area linked).

0 Kudos
by Anonymous User
Not applicable

Thank you! Took a couple trial and error tests but I have it now.

0 Kudos
Peters_Amy
Occasional Contributor

Charleen,

I'm having the same issue as you.  Would you mind taking a minute to paste in your instance name in a response here in the blog for me?  I would like to see how you formatted the date so that the epoch time was formatted to something recognizable as a date.

Thank you,

Amy

0 Kudos
Peters_Amy
Occasional Contributor

James,

I understand that even though a field in the survey is a dateTime field, I still need to format it in the Instance Name.  I can't figure out how to do this.  I keeps showing the epoch time and not a string time.  Could you please paste in an example of code that will format a dateTime field in my survey as a recognizable date (I don't really need time) in the Draft name of the survey?

Thank you!

Amy

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Amy,

Please look at the format-date function within Formulas—Survey123 for ArcGIS | ArcGIS  .  This will allow you to generate a human-readable text from the date value.  For example, to get an ISO day, you can use

format-date(${date_question}, '%Y-%m-%d')

Peters_Amy
Occasional Contributor

James,

I thank you for the super quick response.  Yes, I was looking at the wrong format on the webpage.  Once I looked at the right one, format-date, I was able to get it to work easily.  Thank you so much and my apologies for the oversight.

Amy

0 Kudos
PADEP_GIS
New Contributor II

Hi James ~ might I be able to use the format-date function with the concat function in the instance_name column? Example: concat (format-date(${COLLECTION_DATE}, '%d/%m/%y') " | ", ${COLLECTOR_ID})  This obviously doesn't work. Thanks....

~ John

0 Kudos
DougBrowning
MVP Esteemed Contributor

You are missing a comma I think

concat (format-date(${COLLECTION_DATE}, '%d/%m/%y'), " | ", ${COLLECTOR_ID})

JW_Mapguy
New Contributor II

Good catch, Doug!

0 Kudos