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
Solved! Go to Solution.
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')
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).
Thank you! Took a couple trial and error tests but I have it now.
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
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
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')
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
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
You are missing a comma I think
concat (format-date(${COLLECTION_DATE}, '%d/%m/%y'), " | ", ${COLLECTOR_ID})
Good catch, Doug!