I'm running into a problem on a survey when I'm trying to extract date values from another feature service.
These fields have to be notes and every pull works fine but for the dates. When I extract a date to note it transforms it in epoch format. Usually not an issue, as I would use format-date() to make it readable.
However, whenever I try to use format-date, Connect will return a type mismatch error. Same when using decimal-date-time or date functions.
My first workaround was to keep the birth-date type question as "date" and "read-only". That works for the field and desktop apps but not for the web browser app. Unfortunately, I need this to work on browser as well.
I double-checked that the field type of the pulled date is "date" and I confirm it's "date" and not "string".
I'm attaching a snippet of the survey and the function (minus the url of the pulled service)
I'm out of ideas and wondering if this is a bug or a known issue. I tag the great survey masters @JamesTedrick and @IsmaelChivite for support, but anyone help would be extremely appreciated.
Sorry for the auto-reply, I'm not sure who to tag other then you @IsmaelChivite and @JamesTedrick for help
I was having the same issue on my form. I am working with a consultant - John Lucotch at Equinox Geospatial - and he figured out the following code that works properly:
|pulldata_json_return||pulldata("@layer", "getRecord", "feature service url", "WHERE clause")|
field_name is the name of the field containing the date you wish to return from the feature layer you are querying
John, my consultant, believes that the json where property is returning the date as a string. Converting the string to an integer allows the epoch time to run properly in your code.