Hello everyone,
I created a form to capture bird nesting information and I am having an issue with duplicate entries and the parent global ID. The form basically create a nest record when a new nest is found (nest profile) and it creates an observation record on a related table to create a monitoring log for 30 days (see pic below). The problem is that collecting an observation ( the repeat related table) for an existing record also creates a new entry on the feature service with a different globalID and a child with a another parent global ID. I do have a common nest_Id fied that I can use to link the tables in PRO but I still have the problem of many empty records on the feature service. Does anyone have a suggestion on how to address the problem? Thanks for any suggestions!
JB
Hey there!
I can't say for sure as I haven't tried a workflow to edit related records like the one described above, but my best guess as to why you're getting new entries in your hosted feature layer when selecting "Update existing nest record" is because you're launching from S123 directly.
My understanding is that every time a survey is launched directly from S123, it creates a new record as it's a new instance of the survey. My guess is that in your XLSXform, when selecting "Update Existing Record" there's some kind of pulldata() function based on selected zone to populate that choice list. However, even though "Update Existing" was selected, as the survey was launched in S123, a new instance by default was created before the selection to "Update existing" was even chosen, resulting in a new entry.
The way that I've dealt with editing related records is by launching the survey from a URL (either via Field Maps or a Dashboard) in edit mode where the globalid of the desired feature is appended to the URL. Thus, a new instance of the survey isn't launched (which means no new record), and only the specific related record you want to edit will be active.
An example of that could be in field maps. The parent spatial feature will be shown and when that feature is selected, the popup shows all related nest records as clickable URLs where each URL has the corresponding globalid of the nest appended to it. When selecting the URL for the desired nest, S123 is opened in edit mode (thus a new entry isn't created) and all existing nest details are populated.
I'm not sure if that's exactly how it'd work for you, but hopefully that gives some ideas!
Some resources below:
Survey123 Tricks of the Trade: Web form URL parameters
Survey123 Tricks of the Trade: Editing records in a web form
Understanding Survey123's custom URL Scheme
Survey123 Tricks of the Trade: Encode URL parameters in the web app
Hello Vinzafy,
Thank you very much for your feedback and suggestions. You are absolutely right regarding the survey123 creating a new instance every time the form is submitted. I can fix that by deleting the "blank" entry using notebook but the problem is that the "updated record' on the related table is getting a "new globalID" and not the ID from the first time the record was created. I can pull the previous parentglobalID but I don't know how i can assign that to be the related key for the relationship. I was wondering if there is anyway to assign the parentglobalID manually. I'm trying to avoid field maps because the team is using mobile and desktop to enter the data and also I don't want them to have to install and maintain two apps. Thanks once again for the great info and the links!
JB
Hmm I don't think I fully understand the new record in related table creation.
...the "updated record' on the related table is getting a "new globalID" and not the ID from the first time the record was created.
Apologies, but this is the part that I'm getting a bit confused at. Is the existing nest not being edited, but its attributes are being passed to a new record with a new GUID but with fields populated by the existing nest?
Regardless, I fully agree with you that it's tricky to have to maintain two apps which can get a bit confusing! One solution I have been using is to have team members launch the survey via a dashboard.
When they're editing records, they're always on desktop so what I've done is embedded the survey within the dashboard and have it so that it only triggers when a related record is selected from a list. Once that record is selected, the embedded survey opens with a custom URL that has editing parameters so that the existing record is updated.
Another option (probably more feasible for your use case) would be to have a URL dynamically generate when a related record is selected from a list that triggers Survey123 to open in edit mode for that specific record using the GUID parameter.
It still is two separate locations as opposed to one, but at least it's just a dashboard in a browser as opposed to a second app. Now the issues here are that you need to be online for this to work which may not be possible for your use case. With Field Maps, you can take maps offline which would resolve this, but again, would require a second app and corresponding training for field folks.
Anyways, not sure if that idea is something you could use, but hopefully it helps with brainstorming!
Example Screenshots:
Sorry for the confusion. It is even hard to explain for me!
Here are the requirements for the survey:
Biologists want to streamline the process for collecting information on nesting birds. The information include: nest location, species, nest description, environmental parameters and daily observation on nesting activity. I created a form that have two actions:
Here is the problem with current workflow. The first time the user create a NEW nest record, survey123 creates a globalid and a parentglobalid to relate the feature layer with the repeat table. However, when the user select the option to “Update Record”, the new created observation on the repeated table get a new parentglobalid that does not match the globalID from the selected nest profile. The 2nd observation get the parentglobalid using the globalid from the new blank feature layer record. Does this make sense???
Ahhh I got you now and understand where the discrepancy is coming from. Thanks for detailing that out further.
Unfortunately I'm not sure how to accomplish that workflow solely within S123 without using URL parameters in some format. Apologies I couldn't help further, but I wish you the best of luck!
If there is a way to achieve that workflow and have it be self-contained in S123, that'd be great info to know.
Hi @JoseBarrios1 ,
If I understand correctly, you want to be able to update existing records within a repeat. I am doing something similar, where new surveys are created or existing ones are updated. I currently do this by using the Inbox to update existing records. That way it maintains the parentglobalID. This unfortunately requires the user to verify whether an existing survey exists in the refreshed inbox first. If it doesn't exist they can collect a new survey, if it does exist then they can edit the survey in the inbox. I am trying to figure out a better way to eliminate the need to check the inbox, because users don't always remember and end up creating duplicates anyway.