Select to view content in your preferred language

Cannot attach images in Public Survey

8491
35
Jump to solution
11-20-2017 02:26 PM
by Anonymous User
Not applicable

Hi all,

I have created a public survey with the following settings.

And, whenever an user attempts to attach an image the survey wouldn't submit (sits in outbox with an error).

But, when I change the settings to "editors can see all features;" it works properly.

Can you please look into enabling images with the above settings. As I'd like to keep all survey results private from the public.

Any help is greatly appreciated.

Thanks,

Gee

0 Kudos
35 Replies
TregChristopher
Frequent Contributor

I have the same needs and same issue as Gee...Allow anon submission, with attachments, but keep results private (even from a REST query).

Michael provided an excellent suggested workaround (to not being able to utilize the setting "Editors can't see any features, even those they add" ) but I am still running into the same errors when anon user tries to submit a record with an attachment. (Sent Ismael and James an email about this yesterday before I found this post)

Workflow:

  • Parent feature layer is shared to authenticated users who can add/update features and edit their own data. No problem when they try to submit a record with attachment.
  • The 2nd, "Anonymous Collection" view has same editor settings but definition query was changed to hide records that aren't true for the condition (I tried both ObjectID<0 and MyField<0 with default value set to 0 in REST/Admin)
    • record without attachment gets submitted fine (and no one can query this record at REST, which is great)
    • but a record with photo fails to submit. Error when submitting thru webform is {"layerID":0,objectid:69 filename'mypicture.gif', success:false} and error with desktop app is "Send Error:....Code 405 Invalid attachment parent"
    • record with MyField set to -1 and with attachment again gets submitted fine but then anyone can see this record thru REST query
  • Important to note: I have the same behavior when trying to add a record to a generic webmap, both using the  workaround def query and changing to the expected layer setting of "Editors can't see any features", although James said this is working with the December AGOL update, this doesn't seem to be true (for me).
0 Kudos
by Anonymous User
Not applicable

Hi Treg,

Whilst the December AGOL update addressed the permissions and the query capability for adding attachments anonymously (as James mentioned), we now need to implement the required changes to Survey123 Connect and Field App to coincide with the AGOL changes. We plan to do this in a future release so will keep you updated once released.

Regards.

Phil.

0 Kudos
TregChristopher
Frequent Contributor

I look forward to the implementation in Survey123 but in the meantime, my questions that followed James's response to Gee, were related to:


1. This new functionality (using same settings as Gee's initial screenshot) does NOT seem to be working in AGOL either, so I'm wondering if anyone has been able to get this to work (in a generic webmap or a geoform)? When I open a webmap in an anon browser session and try to to add pic, the record gets submitted but the attachment isn't there. I tried the same thing in a GeoForm with same results, except the GeoForm generate an error message about the attachment before submitting the record. Can anyone verify that this does or doesn't work? If everyone is having success, then it is something with our AGOL Org settings that needs to be updated?


2. Mikie's workaround is a great idea and it seems like it should would work, so I'm wondering if anyone has tried this out with any success. I've used a very similar method on a ArcGIS Server feature service with success but for both Survey123 and a generic webmap, I couldn't get it to work. Has anyone else been able to utilize the workaround?

I've added some screenshots to show the process for #1...adding a record with an attachment in both a generic webmap and a geoform and also the results (from an admin view with full control from the original, 'Add only" HFL). The table shows that no attachments were added except when I accidentally submitted a geoform in the same browser as being logged in the HFL owner)

by Anonymous User
Not applicable

Hi Treg,

I am still experiencing the same issues as you

Michael Kelly‌'s suggestion was great. But, it wouldn't work with attachments.

The best solution that I've come up with is - unselecting all View Definition (Define Fields) of the Feature Layer View.

This would hide all fields from the Feature Layer View, apart from attachments.

Gee

0 Kudos
MichaelKelly
Frequent Contributor

Hi Gee,

I have just tested this out myself and now understand why it is not working.

Attachments are stored as related records (1-m) so you can relate multiple attachments to one specific feature. When adding attachments, the parent record must be available to attach the record. What is happening is the parent record is getting added as expected, but then a second transaction is being made to add an attachment. As the parent record is no longer available (as it is hidden through the view), the attachment cannot be added. It doesn't solve the problem, but explains why this doesn't work. See below for the error message (Invalid attachment parent):

Kind regards,

Mikie

0 Kudos
TregChristopher
Frequent Contributor

Hi Mikie,

Your explanation of why this doesn't work for attachments seems logical. However, your same workaround-technique works perfectly fine for an ArcGIS Server feature service (I've been using it for a couple years to collect anon data with attachments in a GeoForms, while hiding the results from a REST query). Both AGS FS and AGOL HFS are very similar REST-based web services, so I don't see why it would work in one situation and not the other.

Regarding my question #1, it's understandable that Survey123 trails AGOL in functionality but I can't get this (not your workaround but the original "Editors can't see, even features they add") to work in AGOL either and if it's not just me or my HFS or Org settings, why isn't this a huge issue for all sorts of crowd-sourcing data collection?

Treg

0 Kudos
by Anonymous User
Not applicable

Hi Michael Kelly

Thanks for the explanation. I think this is the same reason why I couldn't upload attachments in my initial survey, with the following feature layer settings.

To me this seems like an AGOL issue rather than Survey123. It would be greatly appreciated if you could escalate this.

Thanks,

Gee

James TedrickIsmael Chivite

0 Kudos
IsmaelChivite
Esri Notable Contributor

A quick update on this one.

A fix  is planned for version 2.7 (March 2018).

In the meantime, a workaround consists on enabling ADD and UPDATE permissions in the feature layer.

Thanks for your patience with this.

0 Kudos
TregChristopher
Frequent Contributor

Ismael,

Again, that is great that you are working on this for Survey123 but it seems I need to reiterate two items:

-The problem does not seem to be limited to S123, both Geet and I found the same issue with AGOL (see Geet's and my last replies)...can you or anyone in ESRI either verify or discount what we are seeing?

-Your workaround (switch to 'Add&Update') is not a workaround that solves Geet's (and mine) original goal to both anonymously Collect AND Hide results . Yes, you can now add attachments but it doesn't prevent an anon from querying REST for any records. Please see attached settings and results or try my example out yourself:

add anon data in webmap:https://arcg.is/HiSrX 

add anon data in S123 webform: https://survey123.arcgis.com/share/7cc0503bddd24b4ea6c6eb0735e98d47

query results from either:https://services8.arcgis.com/qxgNeb414AvBYKO7/ArcGIS/rest/services/service_8cac2b6810bd4c63817e6dbef...

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Treg,

We are researching this with the ArcGIS Online team; we have internally replicated the behavior you are seeing.  

0 Kudos