Calculating off a reserved field

385
1
01-31-2019 09:12 AM
TylerDunn2
Occasional Contributor

Here's the long story with a few questions:

I built a Survey via Survey123 Connect for our Code and Compliance group. They spent 3-4 months collecting data and entering surveys. They currently query for analysis off the CreationDate field that is auto generated and created via Survey123 (ex. How many Signs have we pulled in the last week).

They asked for a few modifications to the Survey, which has required a schema change, so I built a new survey (Version 2) and appended the old surveys to the Version 2 via ArcPro. Before I did this, I created a CreateDate field and calculated it to preserve the original CreationDate information. Once it became appended to Version 2, all of the CreationDate auto generated to 1/24/2019 (the date I did the append). Luckily I maintained the original date via the CreateDate field. Moving forward I want to utilize the CreateDate field for their analysis, which means every time a survey is created, it needs to populate CreateDate with CreationDate information that is auto generated.

 

Here's where my questions come in:

1) In my xls form, in order for me to run a calculation on the CreateDate field, the CreationDate field needs to be in the xls. Otherwise it throws an error saying there’s no CreationDate field.

When I add the field (CreationDate) with the same name, alias, field type and read only, it barks when trying to publish that CreationDate isn’t editable

Any suggestions on how to get around this?

2)In terms of the actual calculation, am I able to get away with a simple calculation like ${CreationDate} and it only gets applied to the survey that was just created? Or do I need to do an IF statement ensuring that any CreationDate = 1/24/2019 doesn’t have CreateDate changed. AKA when a new survey is created, does the calculation only apply to the new survey entry, or does it hit the whole database?

0 Kudos
1 Reply
DougBrowning
MVP Esteemed Contributor

CreatedDate is a AGOL thing not a Survey123 thing.  If I remember right it will not be populated until it is sent up to AGOL since AGOL is the one doing all the editor tracking.  There may be some secret field in the background though that Survey123 sends but no idea.  I know there is a field called start and end that keeps track of the time the form was opened.

Why not just have a field called FormDate or something and put the default or calc in as now()?  I do not think now() will update when you reopen the form (which is good).  If it does than once(now()) may work.  I would like this answered as it could make a difference for me.

0 Kudos