Dealing with data (Pulldata) on related tables

745
8
11-23-2017 08:46 PM
Highlighted
New Contributor III

Hi,

I am seeking advice or ideas on how to deal with dataset from asset that has multiple entries under the same field attribute. For example, in one particular bridge, it contains 3 parts in span material and structure. I am not sure what is the best way to display each of these information on Survey123 (prepopulate fields) given that they have the same fieldname. These data would be stored as related tables from the source database.

FIELD_ATTRIBUTEA1A2 (start km)A3 (end km)
STATUS_OF_BRIDGEINSERVICE - MAINTAINED169.61169.742
SPANTYPEMATERIALBMS169.61169.677
SPANTYPEMATERIALSTEEL169.677169.695
SPANTYPEMATERIALBMS169.695169.742
SPANTYPESTRUCTUREARCH169.61169.677
SPANTYPESTRUCTUREINVERTEDTRUSS169.677169.695
SPANTYPESTRUCTUREARCH169.695169.742

I could rename these fields by adding numbers to the end to make the repeats unique, but that would placed them at separate columns, instead of writing back to the same field attribute/column.

Any suggestions will be appreciated.

Regards

SW

Reply
0 Kudos
8 Replies
Highlighted
Esri Frequent Contributor

Hi.  It looks like a repeat may be a good way to model this. I am guessing something like this:

typenamelabel
select_one statusstatus_of_bridgeStatus of Bridge
begin_repeatspan_typesSpan Types
decimalspan_startStart (Km)
decimalspan_endEnd (Km)
select_one materialspan_materialMaterial
select_one structurespan_structureStructure
end_repeat

All questions above the repeat block will be stored in a feature layer. Questions within the repeat will be stored in a related table called span_types.

If you already have all your bridge data  loaded into a feature service, you may want to create a new survey from your feature layer. This will create a new XLSForm for you as described in https://community.esri.com/groups/survey123/blog/2017/09/25/working-with-existing-feature-services-i...

Highlighted
New Contributor III

Hi Ismael,

Thank you. I have tried to get the repeats stored in a relate table to work but am having major blockage. Mainly because I could not work out how to get the relationship to be based on GlobalID field:

I do not have ArcServer, only ArcDesktop & AGOL. When I create a GUID type field in the Table, it is empty. I have no way of linking the GUID type field to the GlobalID of the primary layer. The only way I know how to populate the table is done externally through using Excel. But this set the field as String rather than GUID type field. Once I import the table back into the GDB, and create a new GUID type field, I am unable to force populate the new GUID field from the corresponding String field.  Therefore, the GUID type field remains empty for existing entries.

Will really appreciate any advice and suggestions on how I can establish a working repeat on survey123 given the my difficulties explained above.

Thank you

Siew Wei

Reply
0 Kudos
Highlighted
Esri Esteemed Contributor

Hi SW,

Probably the easiest path is to create the survey with the repeat relationships and then publish the new feature class in ArcGIS Online.  That will get you an empty set of tables properly formatted that you can then fill in with existing data.  To fill in, you can either edit the feature class in ArcGIS Desktop (ArcGIS Pro is a bit better than ArcMap for this, as it can edit directly, rather than require the local copy download) or download a FGDB export of the Feature Layer, add the data to the FGDB in Desktop, and then republish the FGDB as a new set of feature layers in AGOL (and then modify the survey to use a submission_url setting).

Reply
0 Kudos
Highlighted
New Contributor III

Thank you James.

Unfortunately, due to some circumstances, I do not have access to ArcGIS Pro. Therefore, I’m stuck with ArcDesktop.

I proceeded with your suggestion:-

1. created a base Survey using Create Advance from Connect and include two Groups of Repeats (to allow for two tables)

2. Published to AGOL

3. Entered a couple of data to the survey and confirmed data is in both Layer0 and both related tables

4. Download from AGOL to Desktop

5. Manually add a new field and entered a new row to one of the table (defectCapture) AND manually populate the GUID field using ArcDesktop

6. Republished to AGOL with all the downloaded tables and relationship including the GDB ServiceItems

    New field and new entry row have been added to the defectCapture table.

7. Repoint the submission_url to this republished feature layer, and republish the form

8. Download/Update the form on Survey123

9. Refresh the Inbox. All was going good until it tried to get information on the GDB_ServiceItems. An hour… it’s still stuck on the GDB_ServiceItems ☹, so i had to terminate the survey.

Perhaps I shouldn’t republish with the GDB_ServiceItems in Step 6?

So I republish again by overwriting the service and this time without including the GDB_ServiceItems table. When I get to Step 9 above and refresh the Inbox, it is now stuck on Getting service information on Span_Types after cycling through Bridge and defectCapture.

I had not touched the Span_Types table so am perplex why the refresh on Inbox on Survey123 is stuck in getting this table's service.  I had to kill the Inbox action.

Please can someone advice?

Thank you

SW

Reply
0 Kudos
Highlighted
Esri Esteemed Contributor

Hi SW,

Yes I wouldn't have republished the GDB_ServiceItems table.  The usual way I publish is by adding the feature classes and tables in an ArcMap Data Frame and then publishing via ArcMap - this allows me to set the order of the layers and tables.

Reply
0 Kudos
Highlighted
New Contributor III

Hi James,

Thanks for that advice. I have also tried republishing via ArcMap without including the GDB_ServiceItems, but upon attempt in refresh the Inbox on the app, it is stuck on the last item to be loaded . It does seem like a loading issue on Inbox?

Perhaps I did something wrong in my set-up/pointers:

The feature service:

I have the submission_url point to: 

Would it help if you have access to the feature service that it's linked to? I am happy to share the feature service if you would like to email me your username.

Thanks again

Cheers

SW

Reply
0 Kudos
Highlighted
New Contributor

Any solution to this?  I'm having the same issues as described above.  Thanks!

Reply
0 Kudos
Highlighted
Frequent Contributor II

When I got this error it was having a photo in a repeat.  That meant the form FC was related to the repeat table which had a _ATTACH relate off of that.  That makes it 3 levels deep - which will hang your submit. 

(For this project I also had a master FC that held the points to visit which are viewed in collector then related to each form FC so that may have been part of it - but removing the photo in a repeat always fixed it.)

Hard to tell without seeing your full GDB.