Passing date to web vs app is different

1241
9
Jump to solution
07-05-2018 08:32 AM
MikeOnzay
Occasional Contributor III

When I use a custom url to pass a date value from a web map to the Survey123 app I get a blank result. If I pass it to a web form it works.

The date value is coming from a date field

Survey123 2.8.2

Survey Connect 2.8.4

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
JamesTedrick
Esri Esteemed Contributor

Hi Mike,

Passing a date is working in my tests.  The one thing I see is that there is a space between meter_install_date and the = sign- is this in your URL (as opposed to being a GeoNet formatting issue)?

View solution in original post

9 Replies
JamesTedrick
Esri Esteemed Contributor

Hi Mike,

Can you give an example of how the date is formatted in the URL?  

0 Kudos
MikeOnzay
Occasional Contributor III

arcgis-survey123://?itemID=xxx&field:service_address=1201%20ROCKVILLE%20PIK&field:meter_number=xxx&field:meter_install_date =1302825600000&field:meter_size_temp=2%20INCH%20COMPOUND&field:meter_model=SENSUS%20RADIO%20READ&field:meter_mxu=13034618&field:ub_account_number=0901-000098&center=39.0694365,-77.13084415

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Mike,

Passing a date is working in my tests.  The one thing I see is that there is a space between meter_install_date and the = sign- is this in your URL (as opposed to being a GeoNet formatting issue)?

MikeOnzay
Occasional Contributor III

The space was the issue.

It was saved in the URL. I typically build and update these URLs in Notepad++ because I can see the whole URL. I know that I need to ensure there are no carriage returns in the URLs before I copy it back to the popup. I missed this. Another item for my checklist.

Thank you!

0 Kudos
KassandraRodriguez
Occasional Contributor

Hi there

I have a similar question, I'm trying to pass a date from my portal web map to pre-populate my web form but I'm not sure if I'm going about it right. It's date type and esriFieldTypeDate nothing else.

I've tried configuring the data in the attributes to different formats

https://survey123.arcgis.com/share/8f8d10d162d74621bf1ef9fdc602e543?field:PROJ_EA=01-00&field:PROJ_N... 

That's the URL with some text deleted for privacy, any help would be much appreciated.

0 Kudos
KassandraRodriguez
Occasional Contributor

Found the issue finally, the original data was in excel and the date was formatted in a way that arcmap knew it was a Date field type but couldn't do anything with it. So after bringing it in under arcmap standard format it was able to pass the date.

0 Kudos
DougBrowning
MVP Esteemed Contributor

I have a date of 8/20/2019 in Collector but when it passes to 123 it turns into 12/31/1969.

Then I removed the time and that date works but is giving 1 day before now.  So 8/19/2010.

Then I followed this post and made the form datetime.  But now it is back to 1969 if a have time on in the web map and Aug 19 if I leave the time off still.

https://community.esri.com/thread/238793-autopopulating-date-in-survey123-subtracts-1-day 

Any ideas?

thanks

0 Kudos
DougBrowning
MVP Esteemed Contributor

I tried using Arcade to convert it . It does convert it but then it still is wrong in 123. I think you can set a time in ArcMap for the service but my map is nation wide so this is hard to know what to set. I tested with and without a time and nothing will work.

I really wish you could store dates with no time.  Would make all of this so much easier.  None of our times are valid really in our data but it is impossible to ignore.

thanks

See

- Add Attribute expression

- for the expression, pick the function ToLocal in the functions tab, and in the brackets put your time field from the globals tab. eg my time field is Last_Position, so the expression is ToLocal($feature["Last_Position"])

- Edit the name of the expression if you like to something other than Custom

- once you click OK, you'll have access to this new attribute in the fields available to you. configure your pop-up to show this field and you'll get your time converted to your local timezone.

0 Kudos
DougBrowning
MVP Esteemed Contributor

Coming back to this I still cannot get a date to pass from Collector to 123.  I keep getting Dec 31, 1969 at 5:00pm no matter what date I send.

URL is 

arcgis-survey123://?itemID=269b8fefe93b4aa782cdfd873ed1950f&field:PointID={PointID}&field:FieldEvalDate={EvaluationDate}

EvaluationDate is just a regular date field

FieldEvalDate is a dateTime in the form

Popup has today's date

Date gets to 123 as 1969

What am I missing here?  I tried all sorts of variations.  With time, without, all the options in the popup, etc.

I really just want to send the date and no time but that can get funky with timezones.  Anything at this point would be great.  I dug through the service settings and nothing about timezone that I can see.

I then tried an Arcade to create a text string of just the date and sent that over.  It takes that and timezones it (i guess) back to 6:00pm the day before.  I wish we could just send a static date and stop this timezone stuff.  It is a nationwide layer.

I am totally stuck.

Thanks for any help

0 Kudos