I've created a feature report for surveying the status of items in a factory. The items are surveyed once a month. The Survey123 survey looks great. The feature report template puts out a pdf that looks great. One of the fields on the survey is "Inspection Date" for the date of the survey. There is also a field "Previous Inspection Date." When the survey is first carried out, "Previous Inspection Date" will be blank. After a month, on the date of the second survey, I'd like the "Previous Inspection Date" field to be populated with the date of the first survey. Every month when the surveyor surveys a particular item, the date of the previous survey of that item is automatically populated.
I've tried "pullData" syntax in a variety of forms, but none seem to work. Am I just missing something? This must be a common process. I'm in a fairly strict corporate environment. Any suggestions, links, etc., would be great.
Thanks!
Solved! Go to Solution.
I am not sure, I couldn't test with your feature. I did try replacing the url with one of my features and I was able to pull a date. You may check your feature and ensure it is able to be queried.
Open the details page for that feature in AGOL. Scroll down to the URL, and click view, scroll to the bottom and you should see something like this:
If that "Query" is there, I would follow Doug's suggestion above.
Also to get the most recent date, you can add this to the end of your url: "?orderByFields=in_da_da DESC&resultRecordCount=1" (order by your date field in descending order, and return one result).
look at request parameters here: https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformformulas.htm#ESRI_SECTION1_BB97985...
So, you got it to work?? Ugh. I triple checked the url and it is set to allow querying. This is the ONLY time I've wanted one of those obscure ESRI error codes... at least I could google that.
I'm baffled. It's gotta be something right in front of my face...
Sorry to bug you—but did you keep the spreadsheet that worked with your url? Would you mind posting it here (minus your url of course). I've gotten so far off track and have made so many changes, I want to see what worked. _sigh_
I changed everything back to your variables, but the attached does pull the most recent date when I hook it up to one of my feature layers??? If not it may have something to do with your feature layer settings, have you checked the share setting in Survey123 site.
I am not sure if these setting would effect it but worth a shot
Ah yes, all dates are stored as UTC in that format, so if you pull it in a text field you do have to format it.
https://community.esri.com/t5/arcgis-survey123-blog/dates-and-time-in-survey123/ba-p/895528
I switched it back to a date field and it's formatting correctly. But I edited my post above. It's not working for anything other than the first tank. I need to delete all the records from AGOL and try again.
Problem statement:
For any given feature, when it has been surveyed previously, and then is surveyed again, the pulldata syntax should pull in the last surveyed date into the "Prior Inspection" field.
I hooked it back up to my feature layer, the pulldata calculation is pulling the most recent date for multiple different entries??? Are you pulling from the correct feature layer? If you have republished lately, you might check that the url is referencing the correct feature layer. Seems there is either an issue/feature where upon republishing with an overwrite adds a new file with the same name but different service urls.
I'm not sure what happened. At one point, no matter which feature I selected, the "Prior" field would populate with the date of the very first survey I had done. I don't know where that data is stored, but somewhere. And then I went into web Survey123 and deleted the remaining records. Reloaded. Verified that all surveys were deleted. Then checked in the feature layer only to discover remaining records. I know that there is a lot of caching going on, but I don't know if that explains it. I deleted all the surveys in the outbox on iOS. I then deleted the entire survey off the phone and tried again. Still was giving me the identical date for every feature.
I nuked it. Deleted everything from AGOL. Verified the XLSForm and created a new survey. Updated the string with the new feature layer URL.
It works.
Green are new surveys that have no prior survey dates; blue are new surveys of those initial surveys showing the prior survey dates.
I'm going to do some more testing next week and see how it behaves.
I'm going to mark this solved. And if I have other issues, I'll create a new post.
Thank you so much for your help!