Select to view content in your preferred language

Survey123 Web form URL parameters

1125
4
10-15-2020 07:42 AM
SkylerDewey
Occasional Contributor

Using Survey123 Web form URL parameters,  is it possible to pass a date field as one of the field parameters?

0 Kudos
4 Replies
ZacharySutherby
Esri Regular Contributor

Hello Skyler Dewey‌, 

You should be able to pass a date into a date field using the Web form URL parameters. The syntax would look something like: 

https://survey123.arcgis.com/share/<Form item ID>?field:_date=10/14/2020 

Or if the question is a date/time question it would look like: 

https://survey123.arcgis.com/share/<Form Item ID>?field:datetime=10/14/2020%2012:23

This would return October 14th, 2020 12:23 PM.

Thank you, 

Zach

Thank you,
Zach
0 Kudos
SkylerDewey
Occasional Contributor

Thanks for the quick reply.  The date shows up in the url string but it is not populating the field in the form (example of the date showing up just as expected in the browser url &field:SymptomOnsetDate=9/9/2020)? 
Does the field need to be formatted a specific way for it to also display there as well?  

field:CASELastName={LastName}&field:SymptomOnsetDate={IllnessOnsetDate} 

Quite a few fields are passed successfully above is just the first two of the long url.  The field SymptomOnsetDate "type" in Survey123 is just date, it doesn't have any other special formatting associated with it?

typenamelabelhintconstraintconstraint_messagerequiredrequired_messageappearancedefaultreadonlyrelevantcalculationchoice_filterrepeat_countlabel::language1hint::language1media::audiomedia::imagebody::accuracyThresholdbind::esri:fieldTypebind::esri:fieldLengthbind::esri:fieldAliasbody::esri:inputMaskbody::esri:stylebind::esri:parametersbind::saveIncompletebind::typebind::esri:warningbind::esri:warning_messageparameters
dateSymptomOnsetDateEnter Illness Onset DateThis date could be the date of first positive specimen OR Symptom onset dateyesesriFieldTypeDate

Thanks so much for any help figuring out where I'm going wrong here!

0 Kudos
AnneMorrisMC
Emerging Contributor

Hi! Did you ever find a work around for this? I am having the same issue!

 

0 Kudos
CharlesHutchinson1
Occasional Contributor

I think I have also been experiencing this issue. A date passed from a parent feature to child feature in a survey embedded in a dashboard is not being recognised.

Date field in form which should be populated by the date from the url parameter remains greyed out.

To see if any value is coming through via the url the date passed by the url parameter was written to a text field and displays as a formatted date (e.g. Wednesday 1st May 2024, 11:30). When passed to date-time formula in XLS form to try and convert this it returns Invalid format.

Adding other date field instead e.g. CreationDate works albeit drops the time.

It seems like the url parameter is picking up the formatted version of the date string in the parent date field rather than a date value. I tried changing the field formatting using the fields manager in map viewer for the parent layer but no effect.

The workaround was to create a decimal date field for the parent feature which is populated on feature creation. This is then passed from parent to child via the url parameter and converted back to date using the date-time function and used to populate the date field in the child feature.

0 Kudos