I am currently trying to publish a survey with a custom SDE-based feature service. The service includes the point feature layer with a related table (relationship via a GUID; for repeats);the related table has attachments enabled.
The submission url in the form has been edited to that of the feature service, so something like:
When attempting to publish the survey I receive the error:
The custom feature service submission url is not compatible with this survey (The feature service does not meet the requirements for a survey with repeats - supportsApplyEditsWithGlobalIds)
I have not been able to find much about this particular error online--anyone who overcame a similar issue? The error message seems to indicate an issue with the relationship to the related table? But I was able to publish a survey with this database structure previously with no problems. I have also tried to publish the survey with a GLOBAL ID-based relationship, but this also did not work.
Solved! Go to Solution.
Thank you James -- I'm pretty sure it's because I neglected to update the relationship with the inspections attachments (i.e. photos) to use GlobalIDs instead of OBJECTIDs. So do I use GlobalID on both, or do I have to set up a GUID field on the latter? I'm still a little murky on GlobalID vs GUID. I found this post but it doesn't completely answer the question...
@Johnathan, I think you might be misunderstanding my complete schema so I'll explain it.
It is for building inspections, post-earthquake, using the ATC-20 form. So we start with a feature class (building footprints), and then we have a one-to-many relationship with inspections, now using GlobalID and GUID. Each inspection though can have multiple photos taken in the field, so that is another one-to-many relationship. So it's feature class, to a related table, and the items in that related table can have attachments in another related table. My question is for the photos related to the inspections, which are related back to the building footprints, how does the relationship need to be created? Is it GlobalID (of the inspection) to GUID (of the photo)? In any case I can't create a GUID value for an attachment that hasn't been created yet.
For what it's worth, this setup has worked fine in Collector without any GlobalIDs or GUIDs for a couple of years now.
Sorry Paul - I miss read your comment. Yes - you will need to use GlobalIDs for the relationship between the attachment and the inspections table. So you need to make sure the inspections table has a valid GlobalID field and then you can enable attachments on it in the GDB.
Thank you James and Johnathan for your help so far. To tangent a bit... how do you get the name of the attachments to the inspections table, which is related to the building footprints? I followed Ismael's instructions here but I keep getting "Table photorepeat not found". I also found a few references to repeating photo attachments, but nothing definitive...
And here is a snip from my survey. Note that this is in a group (i.e. the related table with the inspection)...
As a recap you have a buildings (feature-layer) and inspections (table) and you have enabled attachments on the inspections table. This means that your survey would have building questions and then a repeat called inspections (or something like that) containing the questions for the inspections table.
You don't need to include the related table for your photos in the survey - this is why you are getting the error. Any image attachments will be added to the inspection record on collection, and then linked to the appropriate survey question via a keyword (the keyword equals the image question name) for the purpose of display. So all you need to do is to add one or more image questions inside the inspections repeat. You can all them whatever you want and have as many as you want - they don't become fields in the inspection table. The only requirement is that you have enable attachments on the table, which I know you have.
So to answer you question: how do you get the name of the attachments to the inspections table: you can't. Attachments do not have a corresponding field, they are just related to the feature/record they were collected against. The Survey123 website is however able to use the keyword/question name property for an attachment to make it possible to view and print image questions like they are fields.
I hope this helps
You are correct in your description of the relationships. However, your statement "add one or more image questions inside the inspections repeat" seems to indicate that I should add multiple questions for photos -- which is method one, in Ismael's comments here -- but that is not what I want to do, because I want the user to be able to add one photo, or 10 photos, or 100 photos, and not be limited. So I want to follow the second method, which indicates I should use a photo in a repeat, so in order to do that there must be a name, per the image in Ismael's post -- I think this is what you might be getting at when you say, "If you were to add an image within the repeat, it would be modeled as attachments to the related table." How do I tell Survey123 to take repeated photos and model those attachments without a value in the name column?
I'd be happy to post attachments and give you access to the survey URL if that would help.
The approach to put an image question within a repeat does work. However not in your case. This is because Survey123 does not support nested repeats and your survey already has the parent layer of buildings and the child table of inspections. The inspections table can not go onto have a child table in the same survey.
A workaround would be to create a form that directly targets the inspections table and then have a related table for the images. This would however mean you would not see any of the questions from the buildings featurelayer in the survey.
If this would work for you I can show you how to do this.
There aren't any questions on the building layer, but I am using that as a starting point -- the user picks a building on a map in Explorer, and then clicks on a link in the building popup to take them to a Survey123 form for that building. So if there's a way to do that with having the form starting directly at the inspections table, I'm all ears.